October 25, 2012 at 8:22 pm
Comments posted to this topic are about the item SELECT (Transact-SQL)
October 25, 2012 at 8:23 pm
October 25, 2012 at 8:53 pm
It was necessary to practice the basics to get where he is today!
October 25, 2012 at 9:04 pm
Nice clean question.
But maybe a little too easy. If one assumes that T-SQL has the sort of consistent syntax that most programming languages have, then only the second and fourth options are possible answers (since if either of the otherw was wrong then so would at leat one more be wrong, and the radio buttons allow for only one); so the only question is whether the "as" keyword can be omitted or whether "a as b" and "b as a" mean the same thing - but letting those mean the same thing would mean one couldn't cope with renaming a column with another solumn's name, whic would be rather odd, so the principle of minimising oddity (which in my experience applies to all languages except C++) tells us the answer straight away.
Tom
October 25, 2012 at 9:16 pm
Thanks for the question.
Jason...AKA CirqueDeSQLeil
_______________________________________________
I have given a name to my pain...MCM SQL Server, MVP
SQL RNNR
Posting Performance Based Questions - Gail Shaw[/url]
Learn Extended Events
October 25, 2012 at 9:25 pm
Easy question..thanks:)
October 25, 2012 at 9:58 pm
An easy one for Friday 🙂
Apparantly, I noticed that there were 4 select statements in the question and 5 select statements as the answer choice 😀
~ Lokesh Vij
Link to my Blog Post --> www.SQLPathy.com[/url]
Follow me @Twitter
October 25, 2012 at 10:31 pm
Easy question.Thanks
Malleswarareddy
I.T.Analyst
MCITP(70-451)
October 25, 2012 at 11:14 pm
One question, I am confused on this...
select ID, name name from person
select ID ID, name name from person
Both these statements dont give any error message and run successfully...
wht is it so?
_______________________________________________________________
To get quick answer follow this link:
http://www.sqlservercentral.com/articles/Best+Practices/61537/
October 25, 2012 at 11:15 pm
I found the glitch ..
nice question...
thanks
~ demonfox
___________________________________________________________________
Wondering what I would do next , when I am done with this one :ermm:
October 25, 2012 at 11:27 pm
An easy one to close the week, thanks!
Need an answer? No, you need a question
My blog at https://sqlkover.com.
MCSE Business Intelligence - Microsoft Data Platform MVP
October 25, 2012 at 11:28 pm
kapil_kk (10/25/2012)
One question, I am confused on this...select ID, name name from person
select ID ID, name name from person
Both these statements dont give any error message and run successfully...
wht is it so?
Think both statements as the following:
select ID, name [AS] name from person;
select ID [AS] ID, name [AS] name from person
The AS keyword is optional when used for aliases in the SELECT statement.
Need an answer? No, you need a question
My blog at https://sqlkover.com.
MCSE Business Intelligence - Microsoft Data Platform MVP
October 25, 2012 at 11:33 pm
kapil_kk (10/25/2012)
One question, I am confused on this...select ID, name name from person
select ID ID, name name from person
Both these statements dont give any error message and run successfully...
wht is it so?
'coz they are syntactically correct. They follow the belew rule
SELECT <column_name> [optional "AS" keyword] [optional <alias_name>]
FROM <table_name>
Alias_name can be same as that of column_name. Hope it is clear now
~ Lokesh Vij
Link to my Blog Post --> www.SQLPathy.com[/url]
Follow me @Twitter
October 25, 2012 at 11:41 pm
Thanks Koen and Lokesh 🙂
_______________________________________________________________
To get quick answer follow this link:
http://www.sqlservercentral.com/articles/Best+Practices/61537/
October 25, 2012 at 11:46 pm
demonfox (10/25/2012)
I found the glitch ..nice question...
thanks
A trick to catch the glitch.
1) Use SSMS, go to "Query" and select "IntelliSense Enabled"
2) Copy paste the code
3) the syntax error in the query (with error) will be highlighted with zig-zag red line 🙂
Check the attached image.
~ Lokesh Vij
Link to my Blog Post --> www.SQLPathy.com[/url]
Follow me @Twitter
Viewing 15 posts - 1 through 15 (of 33 total)
You must be logged in to reply to this topic. Login to reply