Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old July 19th, 2005, 11:20 PM
Nerfherder
Guest
 
Posts: n/a
Default Inner join with where

I have the following SQL statement I need to
add a secondary where clause to

SELECT name, amount
FROM node, log
WHERE log.name (+) = node.name

Now I need to add run_date = '31-JAN-05',
I can not just add this statement since when I do
loose columns in the node table since there is
not a 1:1 match between the two tables.

--
  #2  
Old July 19th, 2005, 11:20 PM
Mark C. Stock
Guest
 
Posts: n/a
Default Re: Inner join with where


"Nerfherder" <nobody@home.com> wrote in message
news:33gd015g73geljerllut1hmer5uruv05rv@4ax.com...[color=blue]
>I have the following SQL statement I need to
> add a secondary where clause to
>
> SELECT name, amount
> FROM node, log
> WHERE log.name (+) = node.name
>
> Now I need to add run_date = '31-JAN-05',
> I can not just add this statement since when I do
> loose columns in the node table since there is
> not a 1:1 match between the two tables.
>
>[/color]

which table is the run_date column in?

bottom line, you have to include the oracle's outer join syntax in all
affected predicates, so, depending on which table RUN_DATE is in, you need
to add either

run_date = to_date('31-JAN-05','dd-mon-rr') (+)

or

run_date(+) = to_date('31-JAN-05','dd-mon-rr')


note also that you should never use implicite date conversion -- either use
TO_CHAR or the ansi date literal syntax (if using 10g)

++ mcs


  #3  
Old July 19th, 2005, 11:20 PM
Nerfherder
Guest
 
Posts: n/a
Default Re: Inner join with where

"Mark C. Stock" <mcstockX@Xenquery .com> said:

Thanks, that worked.
[color=blue]
>to_date('31-JAN-05','dd-mon-rr')[/color]

 

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

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

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles