Click here to Skip to main content
15,902,937 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have one scenarion including 4 tables

doccode ,parentdoccode,gatepasscode are columns in a table

MM.GPVHD its doccode is gatepasscode in MM.GRHDR
MM.GRHDR its doccode is parentdoccode in MM.SRBFD
MM.SRBFD its doccode is parentdoccode in PR.APBFD
PR.APBFD

and i have doccode of PR.APBFD through i which i need to get all records of MM.GPVHD

structure is going from bottom to top


i tried following but coulldnt get



SQL
select * from   MM.GPVHD GP inner join MM.GRHDR GH on GP.DocCode

in(Select GH.GatePassDocCode from  MM.GRHDR GH inner join Qc.QTBFD Q on GH.DocCode
in(select Q.ParentDocCode from  Qc.QTBFD Q inner join MM.SRBFD SR on  Q.DocCode
in(select SR.ParentDocCode from  MM.SRBFD SR  inner  join  Pr.APBFD AP on SR.DocCode
=(select AP.ParentDocCode from  Pr.APBFD AP where AP.DocCode='FY13/API/1'))))


Any help will be appreciable

regards,
Posted

1 solution

 
Share this answer
 
Comments
shivani 2013 14-Sep-13 8:20am    
thanks for your reply .I have already looked this link but no help
if you do it over here .....it wld be really appreciable
Bama Boy 14-Sep-13 8:23am    
u can use w3school website

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