SELECT COUNT('7') ?

 Posted by Bandi on 6/23/2015 | Category: Sql Server Interview questions | Views: 700 | Points: 40
Select from following answers:
  1. Throws error
  2. 7
  3. 0
  4. 1
  5. All Above

Show Correct Answer


Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Posted by: Sojanya on: 6/26/2015 | Points: 10
Yes, the answer for SELECT COUNT() will be always 1. It can be below three examples.
SELECT COUNT(*)
SELECT COUNT(1)
SELECT COUNT('1')

If we associate any of these with any table then it will return the number of rows from that table.
For example:
SELECT COUNT(*) FROM tblSchool

Login to post response