2

Possible Duplicate:
Best way to test if a row exists in a MySQL table

I need to determine if a row exists at least once in table, where for example name = 'Jon'.

Is there is better solution than this?

 SELECT name FROM mytable
 WHERE name = 'Jon'
 LIMIT 1

and after receive count using num_rows.

Community
  • 1
  • 1
Oto Shavadze
  • 37,634
  • 51
  • 140
  • 215

0 Answers0