Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 suggest me the proper querry

Author  Topic 

dasu
Posting Yak Master

104 Posts

Posted - 2004-12-14 : 23:35:05
situation
i have two tables asume
1.child(id int)
2.parent(id int)
in child table has 3 records like this
1
2
2
in parent table has 10 records like this
1
2
3
4
5
6
7
8
9
10
now my problem is that i want to validate the recods that are present in child table.
the validation is like this
i want to check that each and every record in child table present in
parent table or not.
so for this suggest me the solution with out curser and with out local tables.
thanks
dasu.g


Merkin
Funky Drop Bear Fearing SQL Dude!

4970 Posts

Posted - 2004-12-14 : 23:47:01
SELECT *

FROM parent
LEFT JOIN child ON child.id = parent.id


If you see NULLs for the child records, that means that ID is missing.



Damian
Go to Top of Page
   

- Advertisement -