Home » SQL & PL/SQL » SQL & PL/SQL » Issue with multiple column Sub-Query (Oracle 10g R2, Unix)
Issue with multiple column Sub-Query [message #425949] Tue, 13 October 2009 06:24 Go to next message
fakru.y
Messages: 34
Registered: May 2007
Member
When running the attached select query which is having multiple column sub query in the where clause, the query is not returning the data even though the data is present in the main query as well as the sub query. When we use one of the string function like upper() or trim() in the where clause for atleast one of the column, the query is returning the expected result.

Note: Data in both the main query and sub query are in upper case with the same length.

Can anyone suggest what might be the cause for this?
  • Attachment: query.txt
    (Size: 3.62KB, Downloaded 86 times)
Re: Issue with multiple column Sub-Query [message #425950 is a reply to message #425949] Tue, 13 October 2009 06:26 Go to previous messageGo to next message
Michel Cadot
Messages: 63808
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Many of us can't or don't want to load files.
Put your query inline, just take care to format it as explain in OraFAQ Forum Guide, especially "How to format your post?" section.
Make sure that lines of code do not exceed 80 characters when you format.
Indent the code and use code tags.
Use the "Preview Message" button to verify.
Also always post your Oracle version with 4 decimals.

Regards
Michel

[Updated on: Tue, 13 October 2009 06:26]

Report message to a moderator

Re: Issue with multiple column Sub-Query [message #425954 is a reply to message #425949] Tue, 13 October 2009 06:51 Go to previous messageGo to next message
fakru.y
Messages: 34
Registered: May 2007
Member

here is my inline.

WHERE (user_id
,top_parent_geo_desc
,context_type_desc
,context_sub_type_desc) IN (SELECT user_id
,top_parent_geo_desc
,context_type_desc
,context_sub_type_desc
From Table1)
Re: Issue with multiple column Sub-Query [message #425956 is a reply to message #425954] Tue, 13 October 2009 06:58 Go to previous messageGo to next message
Michel Cadot
Messages: 63808
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
SQL> select * from dual where null in (select null from dual);

no rows selected

Regards
Michel
Re: Issue with multiple column Sub-Query [message #425972 is a reply to message #425956] Tue, 13 October 2009 08:06 Go to previous messageGo to next message
fakru.y
Messages: 34
Registered: May 2007
Member
here i have the data in subquery as well as where clause. what might be the cause not returning by the outer query. i tried trim function aalso but no use.
Re: Issue with multiple column Sub-Query [message #425976 is a reply to message #425972] Tue, 13 October 2009 08:37 Go to previous message
Michel Cadot
Messages: 63808
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
The example I posted should warn you of what could be the reason you have not the result you expect.

Regards
Michel
Previous Topic: merging of rows based on column value
Next Topic: without distinct
Goto Forum:
  


Current Time: Thu Sep 29 00:33:51 CDT 2016

Total time taken to generate the page: 0.07645 seconds