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're testing for it
in the first place, right?

The first value (only value!) back from that query will be a number between
0 and how ever many rows match the query.



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. 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 if
> there is no
> rows with that value. Any help soon would be very nice.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to