Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Outer join syntax
Message
 
 
To
07/08/2000 01:32:04
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00401726
Message ID:
00401871
Views:
25
>Hi All,
>
>Is there a standard way of expressing outer joins for any server?
>
>I have following query working in VFP but not under Oracle :
>
>SELECT field1, field2, mytable2.field3 FROM mytable1 LEFT OUTER JOIN mytable2 ON mytable1.field1 = mytable2.field1
>
>Following works under Oracle but not under VFP:
>
>SELECT field1, field2, mytable2.field3 FROM mytable1, mytable2 WHERE mytable1.field1 (+)= mytable2.field1
>
>What I want is a syntax by which both will recognize and execute.
>
>Thanks for any help.
>
>Regards
>Vijay

Vijay,
I believe the following will work in both:
SELECT field1, field2, mytable2.field3 FROM mytable1,mytable2 ;
   where mytable1.field1 = mytable2.field1
UNION
SELECT field1, field2, '     ' as field3 FROM mytable1 ;
   where mytable1.field1 not in (select mytable2.field1 from mytable2)
You have to go back to the days before we had outer joins in VFP.

HTH.
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform