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 |
What are triggers? How many triggers you can have on a table? How to invoke a trigger on demand?
What are “unrepeatable reads”?
When would you prefer to have a minimum number of indexes?
Explain what stored procedure sp_replcounters is used for? : sql server replication
What is a non-clustered index?
Which institute is best for SQL Server 2005 Training?
How to delete an attribute from the emp table
What are the properties of the transaction?
select the 3rd maximum salary from sql server database if 4 (just an example In practically I may not know the exact situation) of the highest salaries are equal.
What is the maximum size per database for sql server express?
What the class forname () does?
Can I delete event logs?
Oracle (3259)
SQL Server (4518)
MS Access (429)
MySQL (1402)
Postgre (483)
Sybase (267)
DB Architecture (141)
DB Administration (291)
DB Development (113)
SQL PLSQL (3330)
MongoDB (502)
IBM Informix (50)
Neo4j (82)
InfluxDB (0)
Apache CouchDB (44)
Firebird (5)
Database Management (1411)
Databases AllOther (288)