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


Please Help Members By Posting Answers For Below Questions

What is the process of normalising?

757


What is clr ddl trigger?

730


What are database states in ms sql server?

835


I have triggers,views,functions,stored Procedures for a table. When I am dropping that table which objects are deleted?

780


Is mysql better than sql server?

736






How do I open a .db file?

734


What are the advantages of having an index on the sql server?

688


While using a cursor, how can you differentiate between a deleted row and a row that has been inserted with null data values?

752


What are constraints?

759


What is a print index?

663


Do you know what are the ways available in sql server to execute sql statements?

731


What is checkpoint in sql server?

818


What does ss stand for sexually?

795


What are the differences between DDL, DML and DCL in SQL?

942


What is key set driven?

705