May 27, 2010 at 10:20 pm
Comments posted to this topic are about the item SQL syntax
May 27, 2010 at 10:24 pm
I did not understand this question.in question it shows that to select wrong sytax.but all resturns table data without any error.then i did not found the wrong answer.so i applied three answers.got my point.
Malleswarareddy
I.T.Analyst
MCITP(70-451)
May 27, 2010 at 10:33 pm
Question was "Which of these SQL statements is correct?". Since all the SQL statements are correct then you have to check all the three answers.
May 27, 2010 at 11:56 pm
The question was:
"Which of these SQL statements is correct? Please guess error message for those stements which are wrong. (select all that apply)"
So 1st you have to select all the statements that are correct, then guess the error statements?
?
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
This thing is addressing problems that dont exist. Its solution-ism at its worst. We are dumbing down machines that are inherently superior. - Gilfoyle
May 28, 2010 at 12:30 am
I have been using
select *from table_name in SSMS 2005, since 2 years & it works fine.
Please try once.
Jinesh.
May 28, 2010 at 12:36 am
Hi, It seems my question was little confusing. but I want to ask which of these SQL statement are right?
So all of the SQL statements was right!!! so you are rightly using the sytatement "select *from table_name"
Sorry for the confusion.
May 28, 2010 at 12:42 am
Hi All the querys are correct
May 28, 2010 at 12:53 am
all the query works without any error
You could have provided the a 4th option which says that all works without any error.
confusing :hehe:
May 28, 2010 at 1:27 am
???????????????????????????????????
😎
Try this:
select*from sysobjects order by 1desc
No space in 1desc
May 28, 2010 at 1:55 am
I agree with others that the second sentence of the question: "Please guess error message for those stements which are wrong. (select all that apply)" gave the impression that we had to check which answers would result in an error message.
Otherwise an intrigueing question about an interesting bit of information that, I hope, nobody will ever use in practice. 🙂 I'm hoping to see more questions from you in the future.
May 28, 2010 at 1:59 am
SELECT*FROM[sysobjects]ORDER BY 1desc
or even
EXEC('SELECT*FROM[sysobjects]ORDERBY1desc')
welcome to SQL golfing - omg LOL
The second thing is especialy bad, play with the order by to see why 😀
May 28, 2010 at 2:18 am
Carlo Romagnano (5/28/2010)
Try this:select*from sysobjects order by 1desc
No space in 1desc
I've seen that too before, same like this:
declare @a int set @a=1select @a
However, select1 or select@a won't work. It seems that a keyword preceded by an integer always works. I would definitely avoid using it though, it only confuses me.
Ronald HensbergenHelp us, help yourself... Post data so we can read and use it: http://www.sqlservercentral.com/articles/Best+Practices/61537/-------------------------------------------------------------------------2+2=5 for significant large values of 2
May 28, 2010 at 2:28 am
EXEC('SELECT*FROM[sysobjects]ORDERBY1desc')
In this case the "order by" clause is missing
ORDERBY1desc is the alias of [sysobjects]
May 28, 2010 at 2:54 am
I've seen that too before, same like this:
declare @a int set @a=1select @a
However, select1 or select@a won't work. It seems that a keyword preceded by an integer always works. I would definitely avoid using it though, it only confuses me.
agreed, it just increases confusion.
However was wondering, when SSMS executes the query, it would have to do some effort to remove spaces between the words 🙂
May 28, 2010 at 4:36 am
ziangij (5/28/2010)
However was wondering, when SSMS executes the query, it would have to do some effort to remove spaces between the words 🙂
SSMS itself does not execute queries because it is a client application. SSMS divides input text into batches, sequentially sends those batches to SQL Server, and displays received results. No spaces are added or removed while sending batches to the server. You can use SQL Server Profiler to see it.
Viewing 15 posts - 1 through 15 (of 37 total)
You must be logged in to reply to this topic. Login to reply