Re: [PHP] Finding existence of a value in a table

2001-03-13 Thread Michael Kimsal
try select count(fieldvaluein) from FROM TableOfInterest WHERE FieldValueIn=ValueOfInterest You don't need the GROUP if you just want the count - from your post and title, it sounds like you just want to know if a value exists in the table. You don't need to know what the value IS, because you'r

Re: [PHP] Finding existence of a value in a table

2001-03-13 Thread CC Zona
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (Dennis Gearon) wrote: > I would like to return ONE ROW if possible from a query that would tell > me > whether a value exists in a table. If the query could result in more than one record, but you only want to see one, 'limit 1' is helpful.

[PHP] Finding existence of a value in a table

2001-03-13 Thread Dennis Gearon
I would like to return ONE ROW if possible from a query that would tell me whether a value exists in a table. I've tried: SELECT FieldValueIn, COUNT(*) FROM TableOfInterest WHERE FieldValueIn=ValueOfInterest GROUP BY FieldValueIn; I can't seem to figure out how to test the return results to see