What is the difference between two queries:
1. SELECT * FROM table WHERE 1=1;
2. SELECT * FROM table
Answer Posted / skumar
Both are returns the SAME results.
I dont know the meaning of the
SELECT * FROM Table_Name WHERE 1=1
SELECT * FROM Table_Name WHERE 2=2
SELECT * FROM Table_Name WHERE 5=5
SELECT * FROM Table_Name WHERE 100=100
.
.
.
etc..,
It accepts the where both are equal.
If you give like
SELECT * FROM Table_Name WHERE 100=1001
It is not accept.
| Is This Answer Correct ? | 34 Yes | 1 No |
Post New Answer View All Answers
How to throw custom exception in Stored Procedure?
Explain the difference between HTTP and HTTPS in database?
What is the difference between cartesian product and cross join?
In one interview...interviewer ask me question pleas tell me sql server architecture.. can any body tell me the sql server architecture with digram
How to apply filtering criteria at group level with the having clause in ms sql server?
Explain how many types of relationship?
How to make remote connection in database?
What are different types of table joins?
explain what is a deadlock and what is a live lock? How will you go about resolving deadlocks? : Sql server database administration
What is a View ? Can we insert, Update and delete a view?
How to get a list of columns in a view using the "sp_help" stored procedure?
What is a livelock?
What is the difference between upgrade and migration in sql server?
What are different types of join?
How do I connect to sql server database?