Click here to Skip to main content
15,891,136 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How to write this query in another manner its working fine but I want to write in efficient manner.
As per standards.
SQL
select  faa.Asset_SN_ID ,faa.PCV_ID,faa.Asset_Code,faa.Serial_No,(famain.Asset_Code+famain.Serial_No) as PCVDescription 
from tblfixedasset as famain
inner join tblfixedasset as faa on famain.Asset_SN_ID = faa.PCV_ID
where famain.Asset_SN_ID=  (select fa.PCV_ID from tblfixedasset as fa where fa.Asset_Code='GSR-U' and	fa.Serial_No='1224') 

and faa.Asset_Code='GSR-U' 
and faa.Serial_No='1224'
Posted
Updated 14-May-14 21:59pm
v2

1 solution

select faa.Asset_SN_ID ,faa.PCV_ID,faa.Asset_Code,faa.Serial_No,(famain.Asset_Code+famain.Serial_No) as PCVDescription
from 
tblfixedasset as famain inner join tblfixedasset as faa on famain.Asset_SN_ID = faa.PCV_ID
where faa.Asset_Code='GSR-U' and faa.Serial_No='1224' 
 
Share this answer
 
Comments
DGKumar 15-May-14 4:11am    
Thank you very much

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