Site Sponsored By: SQLDSC - SQL Server Desired State Configuration
Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Dear sir ,please give solution of given query select gam.cif_id,gam.foracid,RCT.ref_desc ON THE BASIS OF GIVEN CONDITION RCT.ref_code = GAC.free_text_4FROM GAM,RCT TABLEmy query was :-Select RCT.ref_descFrom TBAADM.RCTWhere RCT.ref_desc In (Select RCT.ref_desc From TBAADM.RCT, TBAADM.GAC Where RCT.ref_code = GAC.free_text_4)when i used this query in my main select then it gioves error of ORA-01427: single-row subquery returns more than one please provide the correct solution
ms65g
Constraint Violating Yak Guru
497 Posts
Posted - 2011-04-08 : 07:05:00
select G.cif_id, G.foracid, R.ref_desc FROM GAM GJOIN RCT R ON R.ref_code = G.free_text_4;Select RCT.ref_descFrom TBAADM.RCTWhere RCT.ref_code In (Select free_text_4 From TBAADM.GAC)______________________
vipin_jha123
Starting Member
31 Posts
Posted - 2011-04-08 : 07:27:52
THANKS FOR KIND REPLYBut i want that query in inner oneSelect gam.foracid, (Select RCT.ref_desc From TBAADM.RCT Where RCT.ref_code In (Select TBAADM.GAC.FREE_TEXT_4 From TBAADM.GAC)) tiFrom TBAADM.GAMbut when i am executing this one it shows the same errorplz do the needfull
ms65g
Constraint Violating Yak Guru
497 Posts
Posted - 2011-04-08 : 07:45:03
Try these:
select G.cif_id, G.foracid, R.ref_desc FROM GAM GLEFT JOIN RCT R ON R.ref_code = G.free_text_4JOIN GAC ON R.rec_code = GAC.free_text_4 Select gam.foracid, (Select ref_desc From TBAADM.RCT R Where ref_code In (Select TBAADM.GAC.FREE_TEXT_4 From TBAADM.GAC) and R.ref_code = G.ref_code) tiFrom TBAADM.GAM G
______________________
webfred
Master Smack Fu Yak Hacker
8781 Posts
Posted - 2011-04-08 : 07:53:47
btw. this isn't an ORACLE forum No, you're never too old to Yak'n'Roll if you're too young to die.