Where clause in SQL server is used to filter the records based on some condition. Records will return based on the true condition. Suppose we want to return all records from the table using where clause we need to write the where condition which is always true.
With the help of the below condition, we will achieve this.
Where 1=1 or where ‘’=’’
Let’s see this example.
Without where clause number of records in the table.
Note: I am using AdventureWorks2012 database
With where 1=1
Now with where ‘’=’’
No comments:
Post a Comment
If you have any doubt, please let me know.