Click here to Skip to main content
15,888,113 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
SQL
select registrationno from vehicle_master where registrationno not in(select registrationno from vehicle_superuser)


here there are two vehicles which are not in the vehicle_superuser but its not displaying

i need to display the record of vehicle master which is not in vehicle_superuser
Posted
Updated 23-Nov-11 0:17am
v2

It seems that there is a duplication in column names in two tables so use this one :

SQL
select a.registrationno from vehicle_master a  where a.registrationno not in(select b.registrationno from vehicle_superuser b)
 
Share this answer
 
For me this query is working fine.
Are you getting any error

Provide table structure and sample data of vehicle_master and vehicle_superuser
so that we can help you.
 
Share this answer
 
Comments
ashok_89 23-Nov-11 6:29am    
vehicle_master vehicle_superuser
registrationno registrationno
12 12
16 16
15
ashok_89 23-Nov-11 6:30am    
for me its displaying empty

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

  Print Answers RSS


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