SQL SERVER – Puzzle – SELECT * vs SELECT COUNT(*)
Posted
by pinaldave
on SQL Authority
See other posts from SQL Authority
or by pinaldave
Published on Mon, 30 May 2011 01:30:27 +0000
Indexed on
2011/06/20
16:29 UTC
Read the original article
Hit count: 358
PostADay
|Readers Question
|sql
|SQL Authority
|SQL Puzzle
|SQL Query
|SQL Server
|SQL Tips and Tricks
|T SQL
|Technology
Earlier this weekend I have presented at Bangalore User Group on the subject of SQL Server Tips and Tricks. During the presentation I have asked a question to attendees. It was very interesting to see that I have received various different answer to my question. Here is the same question for you and I would like to see what your answer to this question.
Question: SELECT * gives error when executed alone but SELECT COUNT(*) does not. Why?
Please leave your answer as comment over here. If you prefer you can blog post about this on your blog and put a link here. I will publish valid answer with due credit in future blog posts.
Reference: Pinal Dave (http://blog.SQLAuthority.com)
Filed under: PostADay, Readers Question, SQL, SQL Authority, SQL Puzzle, SQL Query, SQL Server, SQL Tips and Tricks, T SQL, Technology
© SQL Authority or respective owner