January 18, 2013 at 10:31 am
Good One
January 18, 2013 at 6:51 pm
SQLRNNR (1/17/2013)
Hugo Kornelis (1/17/2013)
chgn01 (1/17/2013)
Aliases are not for columns where there is only one column possible.You are completely right - if you never make typo's, never have anyone else changing your tables, and always remember all the code you (and others) have previously written and deployed when modifying tables.
For all mere mortals, prefixing columns (either with full table name or, preferably, alias) is one of the important tools to keep the phone quiet at night.
I'm with Hugo. Even with just 1 column, an alias really is helpful.
Me too. Jason, did you mean "just 1 table" when you said "just 1 column"? If so, I agree that that's best practise, but admit that I sometimes fail to follow it.
Tom
January 18, 2013 at 7:12 pm
It's an interesting question, and an interesting discussion. I'm glad I was too busy to look at it until just now, because I would rather have Hugo explaining this tham me trying to! I just wouldn't have been able to refrain from badmouthing ANSI, ISO, and anyone at all involved in perpetrating this crime against common sense and good language design principles.
Personally, I think this is one place where the SQL standard is a totally stupid mess. This is a really brilliant example which, if it had existed a years earlier, I could have used when mentoring software engineers, of how NOT to make binding rules when defining a language. It's also a brilliant example of how to warp the "scope" concept so as to divorce the language's semantics from its natural reading.
Ideally, I think, the query should return an error.
Tom
February 22, 2013 at 1:36 am
amazing
don't do such things will get headaches if something goes wrong 6 months after
Viewing 4 posts - 46 through 48 (of 48 total)
You must be logged in to reply to this topic. Login to reply