RE: Riddle me this.....

From: SHEEHAN, JEREMY <Jeremy.Sheehan_at_fpl.com>
Date: Thu, 9 Apr 2009 15:38:18 -0400
Message-ID: <8833494F383585499CB855121711D2631391993763_at_JBXEXVS02.fplu.fpl.com>



yes. it is the correct result.

Jeremy
 Consider the environment. Please don't print this e-mail unless you really need to.

-----Original Message-----

From: Mercadante, Thomas F (LABOR) [mailto:Thomas.Mercadante_at_labor.state.ny.us] Sent: Thursday, April 09, 2009 3:32 PM
To: SHEEHAN, JEREMY; oracle-l_at_freelists.org Subject: RE: Riddle me this.....

"just like the other queries" ???

Is the result correct?

-----Original Message-----

From: SHEEHAN, JEREMY [mailto:Jeremy.Sheehan_at_fpl.com] Sent: Thursday, April 09, 2009 3:30 PM
To: Mercadante, Thomas F (LABOR); Channa, Santhosh; oracle-l_at_freelists.org Subject: RE: Riddle me this.....

This returns 48 rows just like the other queries.

Jeremy
 Consider the environment. Please don't print this e-mail unless you really need to.

-----Original Message-----

From: Mercadante, Thomas F (LABOR) [mailto:Thomas.Mercadante_at_labor.state.ny.us] Sent: Thursday, April 09, 2009 3:27 PM
To: SHEEHAN, JEREMY; Channa, Santhosh; oracle-l_at_freelists.org Subject: RE: Riddle me this.....

Just curious.

When you rewrite it like this:

select *
from pjm_nm_sttl_component a, isolink_pjm_sttl_estim_w_iso b

     where  b.sttl_id   =  '131545258'
       and a.sttl_id  = b.sttl_id_iso

what happens?

-----Original Message-----

From: oracle-l-bounce_at_freelists.org [mailto:oracle-l-bounce_at_freelists.org] On Behalf Of SHEEHAN, JEREMY Sent: Thursday, April 09, 2009 3:20 PM
To: Channa, Santhosh; oracle-l_at_freelists.org Subject: RE: Riddle me this.....

I tried this and it still produced the same results with both queries.

The first returned no rows, the second did. Thanks for the hint.

Jeremy
 Consider the environment. Please don't print this e-mail unless you really need to.

-----Original Message-----

From: Channa, Santhosh [mailto:Santhosh.Channa_at_McKesson.com] Sent: Thursday, April 09, 2009 2:59 PM
To: SHEEHAN, JEREMY; oracle-l_at_freelists.org Subject: RE: Riddle me this.....

My first attempt would be using aliases for the tables and refer the columns by alias since the column that you are referring in sub query is common in both the tables.

Regards,
Santhosh Channa

P Consider the environment. Please don't print this e-mail unless you really need to.

-----Original Message-----

From: oracle-l-bounce_at_freelists.org
[mailto:oracle-l-bounce_at_freelists.org] On Behalf Of SHEEHAN, JEREMY Sent: Thursday, April 09, 2009 2:47 PM
To: oracle-l_at_freelists.org
Subject: Riddle me this.....

Ok. Here's an interesting question that some developers threw at me. I don't see anything wrong with the statement but it just does not work....

This statement does not work.....

select * from pjm_nm_sttl_component

    where sttl_id in -- this statement has the 'in'  (select sttl_id_iso from isolink_pjm_sttl_estim_w_iso

     where  sttl_id   =  '131545258'                   
     ) 
     

but this one does:

select * from pjm_nm_sttl_component

    where sttl_id = -- this statement has the '='  (select sttl_id_iso from isolink_pjm_sttl_estim_w_iso

     where  sttl_id   =  '131545258'                   
     )


The subquery works. I can even run the 4 statements. It pulls back the same data as the second statement above.

select * from pjm_nm_sttl_component

    where sttl_id in (130637378)

select * from pjm_nm_sttl_component

    where sttl_id in ('130637378')

select * from pjm_nm_sttl_component

    where sttl_id = 130637378

select * from pjm_nm_sttl_component

    where sttl_id = '130637378'

We're running 10.2.0.4 on AIX 5.3.7

Any ideas?

Jeremy
Consider the environment. Please don't print this e-mail unless you really need to.
--
http://www.freelists.org/webpage/oracle-l

zXʃn{i
i0zX+n{+i^ Received on Thu Apr 09 2009 - 14:38:18 CDT

Original text of this message