db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rick Hillegas <Richard.Hille...@Sun.COM>
Subject Re: Derby Syntax for (+)?
Date Thu, 19 Feb 2009 13:35:23 GMT
Hi Kent,

I believe that this is Oracle's old syntax for outer joins. I think that 
Oracle 9i added the ANSI standard syntax to Oracle. As I recall, the old 
syntax gave rise to non-standard results.

Regards,
-Rick

Kent Spaulding wrote:
> thanks for the quick reply - I suppose I'll try left and right outer 
> joins ;-)
>
> So (+) is shorthand, not part of the standard SQL?
>
> --Kent
>
> On Feb 18, 2009, at 11:24 PM, Bryan Pendleton wrote:
>
>>> select distinct o.d, o.u, o.e
>>>  from my_table o, my_table_2 t
>>> where o.u = t.u(+)
>>>   and t.u is null
>>>   and o.u not like 'P%';
>>> This fails with a syntax error - on the (+) on line 3 of the SQL - 
>>> what's the corresponding Derby syntax?
>>
>> Looks like you may be trying to write an outer join. You can
>> find the Derby syntax for outer joins documented here:
>> http://db.apache.org/derby/docs/10.4/ref/rrefsqlj18922.html
>>
>> I think you'll want something like
>>
>> select distinct o.d, o.u, o.e
>>   from my_table o left outer join my_table_2 t on o.u = t.u
>>  where t.u is null and o.u not like 'P%';
>>
>> thanks,
>>
>> bryan
>>
>


Mime
View raw message