what is the out put of below queries?
a. select * from Emp where null = null;
b. select * from Emp where 1=1;

Answer Posted / jerry joseph

a. select * from Emp where null = null;

null = null will be always false.. so no rows returned..
change the query to "select * from Emp where null is null;"
to select all rows

b. select * from Emp where 1=1;

1 = 1 will be always true.. so all the rows are returned..

Is This Answer Correct ?    17 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What languages bi uses to achieve the goal?

515


How do you delete a data source?

556


How to start and end transact-sql statements?

586


Explain a differential backup?

576


What stored by the model?

552






What is create command?

527


How to create a simple user defined function in ms sql server?

547


If we delete pack Spec what will be the status of pack Body ?

972


How to delete existing rows in a table?

593


Where is my database stored on the hard disk in ms sql server?

597


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

593


How to write a query with a right outer join in ms sql server?

485


Why use identity in sql server?

568


How to drop an existing table?

557


What are the differences between having and where clause.

560