dbTalk Databases Forums  

Combining SQL statements

comp.databases.oracle.misc comp.databases.oracle.misc


Discuss Combining SQL statements in the comp.databases.oracle.misc forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
RebelScum
 
Posts: n/a

Default Combining SQL statements - 10-17-2003 , 08:17 AM






I have two sql statements that I would like to join into one statement

the first is
SELECT node_data.node_name
FROM tsmadmin.node_data
WHERE( node_data.contact = lower( 'email' ))
ORDER BY node_name

the second
SELECT contact, report
FROM report_freq
WHERE( contact = lower( 'email' ))

I can't do a normal join since email may not be in the
report_freq table.

Reply With Quote
  #2  
Old   
Rene Nyffenegger
 
Posts: n/a

Default Re: Combining SQL statements - 10-17-2003 , 03:34 PM







Quote:
I have two sql statements that I would like to join into one statement

the first is
SELECT node_data.node_name
FROM tsmadmin.node_data
WHERE( node_data.contact = lower( 'email' ))
ORDER BY node_name

the second
SELECT contact, report
FROM report_freq
WHERE( contact = lower( 'email' ))

I can't do a normal join since email may not be in the
report_freq table.
I wonder if someone finds out what exactly you want and what you mean by
'joining into one statement'.

I'd have said you need to look up the 'union' operator, but with your
last statement (about email not being in report_freq) makes me doubt
that's what you want.

If you expect someone to help you, you should give a little more effort
and reveal more details.

Rene


--
Rene Nyffenegger
http://www.adp-gmbh.ch


Reply With Quote
  #3  
Old   
Hans Forbrich
 
Posts: n/a

Default Re: Combining SQL statements - 10-17-2003 , 04:08 PM



RebelScum wrote:
Quote:
I have two sql statements that I would like to join into one statement

the first is
SELECT node_data.node_name
FROM tsmadmin.node_data
WHERE( node_data.contact = lower( 'email' ))
ORDER BY node_name

the second
SELECT contact, report
FROM report_freq
WHERE( contact = lower( 'email' ))

I can't do a normal join since email may not be in the
report_freq table.
Your question seems to be mainly relevant to the mind readers amongst
us. Since I don't claim taht ability, I for one have no idea what you
might want to accomplish. Seems like the problem statement might use a
bit of a diagram to back it up.

If you can't use a 'normal' join, how about an 'abnormal' one? Variants
might include UNION, INTERSECT, left or right outer join, or
non-equijoin. Most text books include a decent description of these
variants. (If you mean 'values missing in one table but not the other',
then that might be a prelude to an outer join.)

--
/Hans
[mailto:`echo $from" | sed "s/yahoo/telusplanet/g"`]


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.