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

Write a SQL command to insert and update only a particular field?

696


How do I find the transaction log size in sql server?

583


What is transact-sql ddl trigger?

699


How do you open a cluster administrator?

684


How do you send email on SQL Server?

638






What do we need queues in sql service broker?

581


Suppose you want to implement the one-to-one relationships while designing tables. How would you do it?

606


What is the data type of time?

581


Which autogrowth database setting is good?

676


How to execute function in stored procedure sql server?

618


How to create “dependant” parameter “make, model, year”

95


What are the differences between ms sql server & oracle?

615


What are the advantages of sql azure?

122


Why are you getting errors when creating a new odbc dsn?

675


What is the default Port No on which SQL Server listens?

689