Will below query return records?

Select * from employee_master where 1 = 1;

If employee_master have only 25 rows.

 Posted by vishalneeraj-24503 on 12/6/2013 | Category: Sql Server Interview questions | Views: 1975 | Points: 40

Yes,It will definitely return all records as 25 records are there in employee_master.Because select query filters rows based on where clause.If condition is true otherwise will not return any record if condition is false.

Here 1=1 means condition is true.That's why it will return all records.

Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response