Any benefit to listing unused columns in SELECT statement?
From: Larry Leonard <Spam_at_DefinitiveSolutions.com>
Date: 2 Jan 2003 10:15:58 -0800
Message-ID: <27270a53.0301021015.41e39a92_at_posting.google.com>
Date: 2 Jan 2003 10:15:58 -0800
Message-ID: <27270a53.0301021015.41e39a92_at_posting.google.com>
I've inherited a large body of SQL statements, and many of them use
this kind of idiom:
select name, state, zip
The interesting part is that (this is oo4o, BTW), only the 'name'
value is used later on in the (C++) program. So, it looks to me as if
(a) the original author thought that if a column appeared in the where
clause, it had to also appear in the select clause, or (b) this is
from customers
where state = 'NY'
and zip = '11011';
Any ideas? TIA. Received on Thu Jan 02 2003 - 19:15:58 CET