Click here to Skip to main content
15,909,530 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
One is Demand table and another table is VarientCountry i want only thoes records that are not map with VarientCountry table

Demand Table

Id Varient Country
1     v1       India
2     v2       NULL
3     v3       Nepal
4     v4       Japan

VarientCountry Table

Id Varient Country
1    v1       India
2    v1       Uk
3    v2       China
4    v1       Indonisia
5    v3       Nepal
6    v4       Egland
7    v4       Null

I want Excepted Result like as

Id Varient Country
1     v1       UK
3     v2       China
6     v4       England


What I have tried:

One is Demand table and another table is VarientCountry i want only thoes records that are not map with VarientCountry table

I want Excepted Result like as

Id Varient Country
1     v1       UK
3     v2       China
6     v4       England
Posted
Updated 18-Feb-18 3:31am
v2

1 solution

Try:
SQL
SELECT vc.*
FROM VarientCountry vc
LEFT JOIN Demand d ON d.Country = vc.Country
WHERE d.Country IS NULL
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900