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

How does stuff differ from the replace function?

555


Distinguish between nested subquery and correlated subquery?

551


How to set database to be single_user in ms sql server?

570


What happens if the update subquery returns no rows in ms sql server?

592


What is difference between order by and group by?

578






What is the difference between the 2 operating modes of database mirroring?

578


Is it possible to have clustered index on separate drive from original table location?

517


How to create a new schema in a database?

555


Which command is used for user defined error messages?

563


As per your opinion what are the five top responsibilities of a dba? : sql server database administration

614


What are the differences between stored procedure and the dynamic sql?

587


What factors you will consider calculating the storage requirement for that view?

552


Why do you want to join software field as you have done your BE in Electronics?

1707


How to enter date and time literals in ms sql server?

511


How to read data in a table with "select" statements?

564