Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Problems w/compound SQL statement
On Tue, 3 Mar 1998 17:55:55 -0500, "Kevin Lloyd" <kevinl_at_centrelab.com> wrote:
Hi,
did you check wether SAMP_JOINID in QCLINK has trailing blanks?
>Below is an example of a compound SQL statement that returns 0 rows (Example
>#3) when using tables "QCLINK" and "SAMPHEADER".
>
>Each individual SQL query returns at least one row (Examples 1 &2).
>
>Also below, is an example of a compound SQL statement that returns 1 row
>(Example #4) when using tables "SAMPHEADER" and "SAMPDATA".
>
>**************************************************
>
>My questions is this: can anyone think of a reason why the compound select
>statement using the qclink table won't work ???
>
>*************************************************
>
>
>1) Individual SQL statement #1
>
>SQL> SELECT SAMP_JOINID FROM SAMPHEADER WHERE SAMP_JOINID='SJ322977';
>SAMP_JOINID
>--------------------
>SJ322977
>
>
>2) Individual SQL statement #2
>
>SQL> SELECT SAMP_JOINID FROM QCLINK WHERE SAMP_JOINID='SJ322977';
>SAMP_JOINID
>--------------------
>SJ322977
>SJ322977
>SJ322977
>SJ322977
>SJ322977
>
>
>3) Compound SQL Statement using QCLINK in ()
>
>SQL> SELECT SAMP_JOINID FROM SAMPHEADER WHERE SAMP_JOINID IN
> 2 (SELECT SAMP_JOINID FROM QCLINK WHERE SAMP_JOINID='SJ322977');
>no rows selected
>
>
>4) Compound SQL Statement using SAMPDATA in ()
>
>SQL> SELECT SAMP_JOINID FROM SAMPHEADER WHERE SAMP_JOINID IN
> 2* (SELECT SAMP_JOINID FROM SAMPDATA WHERE SAMP_JOINID='SJ322977')
>SAMP_JOINID
>--------------------
>SJ322977
>
>
>
>
-- Regards Matthias Gresz :-) GreMa_at_T-online.deReceived on Wed Mar 04 1998 - 00:00:00 CST