Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
(natural?) join question
Message
From
01/02/1999 13:38:26
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
01/02/1999 13:32:05
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00182610
Message ID:
00182619
Views:
7
>Using VFP 5.0a on WinNT 4.0 sp3.
>
>I want to do a select statement on two (or possibly more) tables where the results are based on an equal condition of a field from each table.
>
>If I do a "select * from a, b where a.id = b.id" I will get the desired result except that I'll get two fields named a.id_a and b.id_b, but no field named a.id or b.id.
>
>One way to do this would be to list all the desired fields in the output, but this list is very long and there is a limit (I think the list is limited by number of chacters), it is prone to errors, and just plain nasty looking.
>
>I think that what I am describing is a natural join, but I am not finding anything on natural join or the reference to the SELECT - SQL command.
>
>I do not care if I get a field named something like a.id_X or b.id_X, but I would like to guarantee a field named a.id (or tablename.id). Is there an easy way to do this?
>
>TIA,
>Marc Mandel
select a.id as id, * from a, b where a.id = b.id
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform