B&T
3-9-04, 08:34 AM
I have two situations where I know there must be a simple/better way to do what I am doing.
1) I simply want to see if a value is in the database. I am currently doing a select using where for that elements value. Then I load the array and check to see if anything is there. There must be a simple one-step way to do this?
2) I have many rows (say 100) with duplicated values in an element (so say there are 10 unique element values and 90 are duplicates). I want to get the 10 unique values. I am doing a select * to read everything. Then in my script I run through the array and find unique values for the element. There must be a simple way to have the sql return only 10 rows (in my example) rather than have that extra code in my script?
Just trying to clean up some code.
1) I simply want to see if a value is in the database. I am currently doing a select using where for that elements value. Then I load the array and check to see if anything is there. There must be a simple one-step way to do this?
2) I have many rows (say 100) with duplicated values in an element (so say there are 10 unique element values and 90 are duplicates). I want to get the 10 unique values. I am doing a select * to read everything. Then in my script I run through the array and find unique values for the element. There must be a simple way to have the sql return only 10 rows (in my example) rather than have that extra code in my script?
Just trying to clean up some code.