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

Answer Posted / jay vardhan singh

select * from Emp where null = null;

null can not be equal to null.So,Condition is not satisfied.
So,it will give only column name.

select * from Emp where 1=1;

1 is always equal to 1.So,Condition is satisfied ,So It
will give all data which is present in table.

Is This Answer Correct ?    23 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How much does sql server 2016 cost?

540


Is it possible to run multiple publications and different type of publications from the same distribution database? : sql server replication

575


How to rename an existing column with the "sp_rename" stored procedure in ms sql server?

556


How to transfer data from a cursor to variables with a "fetch" statement?

586


What do you mean by an execution plan? Why is it used? How would you view it?

534






Explain the microsoft sql server delete command? : SQL Server Architecture

585


How do I install sql server?

472


Do you know what is blocking?

543


How can you control the amount of free space in your index pages?

620


what exactly sql injuction.how to overcome.....

2043


1.what are diff types of joins , and explain diff between cross join and full outer join 2.diff types of views 3. Diff types of index 4. What is diff b/w stores procedure and function procedure 5.diff between double and int in SQL 6.diff between char and varchar in SQL. 7.Oracle or SQL whice you will preferred and why.

1098


How many types of functions are there in sql server?

467


How to change a login name in ms sql server?

564


How to count rows with the count(*) function in ms sql server?

540


What are the different types of join?

573