Click here to Skip to main content
15,899,825 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have two table each one has single column named as "Accessno " and "AccessNo " i just want to get unique data which is not available in second table column
here is my sql query
"select m.Accessno from tatbx m left join tb_mstrmaterial d on d.AccessNo=m.Accessno where d.is null"
first table name :tatbx
seccnd table name : tb_mstrmaterial

thnx in aduvance

tatbx | tb_mstrmaterial
Accessno | AccessNo
a1 | a1
a2 | a4
a3 |
a4 |
the out put should come like a2,a3
Posted
Updated 15-Jun-15 20:03pm
v5
Comments
OriginalGriff 16-Jun-15 1:54am    
This is not a good question - we cannot work out from that little what you are trying to do.
Remember that we can't see your screen, access your HDD, or read your mind.
Perhaps sample data from both tables, and an example of teh output you want would help?
Use the "Improve question" widget to edit your question and provide better information.

I think it's a small error in your SQL. Try changing this:
SQL
select m.Accessno from tatbx m left join tb_mstrmaterial d on d.AccessNo=m.Accessno where d.is null
To
SQL
select m.Accessno from tatbx m left join tb_mstrmaterial d on d.AccessNo=m.Accessno where d.AccessNo is null
 
Share this answer
 
Comments
Muhammed Ali Kc 16-Jun-15 2:41am    
i want only unique values from first table like
a1|a1
a2|a3
a3|
the result should come like this a2 only
thnx
This should also work:
SELECT Accessno FROM tatbx EXCEPT SELECT AccessNo FROM tb_mstrmaterial 
 
Share this answer
 
Comments
Muhammed Ali Kc 24-Jun-15 6:53am    
thnx..

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