Use EXISTS instead of COUNT to check if a record, satisfying your search criteria, exists in a table.

Elegant programming means not only producing a code which is elegant cosmetically and easy to read. For example, inefficient code doesn't look very elegant to me even if it is perfect cosmetically... I don't feel comfortable seeing the following construction which performs full table scan even if the wanted record is just the first of the million: