Re: Best method for checking if a row exists.

2008-12-12 Thread Perrin Harkins
SELECT EXISTS( SELECT * FROM WHERE ) - Perrin -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org

Best method for checking if a row exists.

2008-12-12 Thread Nicholas Ring
Hello, What is the best method to check if (one or more) row exists (note: primary key is auto inc and table engine is InnoDB - but what if these were not true) ? 1) SELECT * FROM WHERE Check to see if the result set is non-empty. 2) SELECT COUNT(*) AS cnt FROM WHERE Check to see if the f