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.
Answers were Sorted based on User's Feedback
Answer / gangadhar
select * from table2 where id not in ( select id from
table1)
Is This Answer Correct ? | 18 Yes | 0 No |
Answer / debi
(select * from table2)
minus
(select * from table1)
Is This Answer Correct ? | 6 Yes | 6 No |
Answer / newbie
SELECT * from Table2
EXCEPT
SELECT * FROM Table1
Is This Answer Correct ? | 1 Yes | 1 No |
Answer / madhu sudhan g
Hiii
Its very simple to get the records that doesn't match lets
table1 is No1 and having A column values 1,2,3,4,5 and Table2
is No2 having column B values 1,2,3,4,5,6,7,8,9,10
Now Query is
select B from NO2 where B NOT IN(select A from NO1)
Is This Answer Correct ? | 0 Yes | 0 No |
After removing a table from database, what other related objects have to be dropped explicitly?
Tell me time data type, datetime2, datetimeoffset data type in sql server 2008?
How to define output parameters in stored procedures?
Why we use trigger in sql server with example?
What are the different ways you can create databases in sql server?
What happens if you delete a table that is used by a view?
What samples and sample databases are provided by microsoft?
What are the different types of backup avaible in SQL SErver
What does it mean if @@cursor_row returns a negative number?
Define right outer join?
Can primary key be null?
Please give me queries for the following 1. To get the count of duplicate records. 2. A query to delete the duplicate records.