Don't expand wildcard within EXISTS
Don't expand wildcard occurrences within EXISTS clause.
WHERE EXISTS(SELECT * FROM tab1)
should not expand to
WHERE EXISTS(SELECT col1, col2, col3 FROM tab1)
5
votes
Anonymous
shared this idea
SQL Prompt 6.2 doesn’t expand wild cards in exists statements, you can download it from http://www.red-gate.com/products/sql-development/sql-prompt/
-
Stephen Anslow commented
Prevention, with equivalent results:
WHERE EXISTS ( SELECT 1 FROM ... )
will NEVER expand undesirably and obviates the frowned-upon SELECT *