hi,

how to match retrieve the unmatched records from 2 tables
in which we dont have any primary key. example : table1 has
1,2,3,4,5 and table2 has 1,2,3,4,5,6,7,8,9,10 and i want
the numbers from 6 to 10 to be displayed and should not
come as null. i need the numbers. please reply as soon as
possible.

Answer Posted / gangadhar

select * from table2 where id not in ( select id from
table1)

Is This Answer Correct ?    18 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why use update_statistics command in sql server?

652


What is coalesce and check constraint in sql server?

615


Can a stored procedure call itself or a recursive stored procedure? How many levels of sp nesting is possible?

664


how to overcome kernel isssues

1269


How the authentication mode can be changed?

735






What command do we use to rename a database?

690


What is model database in sql server?

682


What are the disadvantages of using querystrings to send data from one page to another?

675


What are the dis_advantages of stored procedures, triggers, indexes?

1787


Do I need a report server to run reports in my application?

116


What is service broker?

684


What is the difference between a unique key and primary key?

586


What is optimistic concurrency?

640


Explain what is lock escalation?

671


How to use copy and concatenate commands in SQL?

693