Bed Against The Wall

Sat 15 September 2007, by Seppe "Macuyiko" vanden Broucke
SQL: Check Existing Rows Matching A Condition

Instead of this:

IF (SELECT COUNT(*) FROM Table1 WHERE ... ) > 0

use this:

IF EXISTS(SELECT * FROM Table1 WHERE ...)

Great tip provided by this article.


Bed Against The Wall by Seppe "Macuyiko" vanden Broucke
Unless mentioned otherwise, this work is licensed under a Creative Commons Attribution-Share Alike 2.0 Belgium License.
Static blog engine powered by Pelican.