473,395 Members | 1,403 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

DeCode in Column List

I am trying to run the query below and its giving me an error saying "single row subquery returns morethan one row". Is there an another way to do this?
I need Funding Source 17/18 as Yes/No column and Funding Source 28 as another Yes/No Column along with other coulmns.
PLease treat this as urgent.

Thanks.

SELECT Unique (ETA.CLNT_ID),
TC.CLNT_FNAME,
TC.CLNT_LNAME,
TC.CLNT_DOB,
LG.GENDER_NAME,
RACE_NAME,
ETA.ACCEPTED_DT,
ETA.TERMINATED_DT,
DECODE (FS1.FUNDING_SRC_ID, 17,'Yes',18,'Yes'),
(SELECT DECODE (FS2.FUNDING_SRC_ID, 28,'Yes')
FROM
APPLICATION.T_ET_ASSESSMENT ETA, APPLICATION.T_ET_ASMT_FUNDING_SOURCES FS2,
APPLICATION.T_CLIENT TC,
APPLICATION.L_GENDER LG,
APPLICATION.T_CLIENT_RACE TR,
APPLICATION.L_RACE LR

WHERE TC.CLNT_ID = ETA.CLNT_ID
AND TC.CLNT_ID = TR.CLNT_ID
AND TC.CLNT_ID = TR.CLNT_ID
AND ETA.ET_ID = FS2.ET_ID
AND TC.CLNT_GENDER = LG.GENDER_ID
AND TR.RACE_ID = LR.RACE_ID
AND TC.CLNT_DOB < to_date ('1992/01/01','yyyy/mm/dd')
AND (ETA.TERMINATED_DT > to_date ('2004/12/31','yyyy/mm/dd') OR ETA.TERMINATED_DT is null)
AND ETA.ACCEPTED_DT < to_date ('2006/01/01','yyyy/mm/dd')
AND FS2.FUNDING_SRC_ID = 28)

FROM APPLICATION.T_ET_ASSESSMENT ETA,
APPLICATION.T_ET_ASMT_FUNDING_SOURCES FS1,
APPLICATION.T_CLIENT TC,
APPLICATION.L_GENDER LG,
APPLICATION.T_CLIENT_RACE TR,
APPLICATION.L_RACE LR

WHERE TC.CLNT_ID = ETA.CLNT_ID
AND TC.CLNT_ID = TR.CLNT_ID
AND TC.CLNT_ID = TR.CLNT_ID
AND ETA.ET_ID = FS1.ET_ID
AND TC.CLNT_GENDER = LG.GENDER_ID
AND TR.RACE_ID = LR.RACE_ID
AND TC.CLNT_DOB < to_date ('1992/01/01','yyyy/mm/dd')
AND (ETA.TERMINATED_DT > to_date ('2004/12/31','yyyy/mm/dd') OR ETA.TERMINATED_DT is null)
AND ETA.ACCEPTED_DT < to_date ('2006/01/01','yyyy/mm/dd')
AND (FS1.FUNDING_SRC_ID = 17
OR FS1.FUNDING_SRC_ID = 18)
Aug 25 '08 #1
2 1949
amitpatel66
2,367 Expert 2GB
I dont find any JOIN in the subquery that connects between itself and the outer MAIN query??.....You will need to link the MAIN query and the subquery in order to solve this problem
Aug 25 '08 #2
How do I do that?

Thanks
Aug 25 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: David Stephenson | last post by:
Hello list, When using 'decode' is it possible to combine 2 different search values into 1 e.g decode(a.country, 'CH', di.identity,'JA', di.identity, de.identity) it would be nice to say...
1
by: etravels | last post by:
Hiyas I am currently working on Oracle Report which ties in with my a report in the ebusiness suite of Oracle telesales module. Basically, the address on statement reports have blank fields...
0
by: Matt Oefinger | last post by:
Hello gurus, I'm trying to do a search through an encrypted database (to which I have the key). I want to use the LIKE operator in MySQL rather than dumping out all entries and sorting in Perl,...
1
by: Sherman H. | last post by:
I have to run a query to give a column a value based on a time range. Can I use DECODE? select decode(trans_date, trans_date>='01-Jul-2002' and trans_date<='30-Jun-2003','Fiscal2002', .....) as...
0
by: Simon | last post by:
Newbie alert! I have a webform listbox with what I am sure is a common requirement. I wish to store a list of values but display a "translation" or decode. An example would be 1, 2, 3, 4 and One,...
1
by: MP | last post by:
I have the following command. SELECT A.STORE_NAME, A.STORE_NUM, A.ZIP_CODE, B.EMPLOYEE_ID, B.GENDER, B.EMP_LEVEL, C.ITEM_CODE, DECODE(B.ITEM_CODE,1, 'CHICK_BURGERS') ITEM_DESCR,...
2
by: wfs | last post by:
Hi All, does anyone know how to decode a compiled SQL statement (db2 z/os 7.1 - skeleton cursor table) I'm trying to find all bound sql statements where the columns in a 'where' clause are of...
4
by: Oleg Parashchenko | last post by:
Hello, I'm working on an unicode-aware application. I like to use "print" to debug programs, but in this case it was nightmare. The most popular result of "print" was: UnicodeDecodeError:...
1
by: dande | last post by:
my problem is I have used invoice table, patient table.In Invoice table date,cash,credit, cheque,advance,total is coming.but in patient table having registration type code having gen registraion...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.