Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL Join or Where
Message
From
02/03/2001 12:03:52
Cindy Winegarden
Duke University Medical Center
Durham, North Carolina, United States
 
 
To
02/03/2001 11:29:49
Edward See
Magicalogic Consultancy System
Quezon, Philippines
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00481412
Message ID:
00481433
Views:
11
Edward

WHERE is the same as INNER JOIN. You have to use LEFT JOIN to get parent records which have no matching children. In SQL installaations which don't support the JOIN statement you can sinmulate this with a UNION of the records that are "NOT IN."

You didn't say whether you're using VFP only or using the SQL language to access some other ODBC compliant database. The best SQL book is Joe Celko's SQL for Smarties: Advanced SQL Programming, Second Edition. He's also written a book called something like "SQL Puzzles and Answers."

With VFP only you can also use SELECT LOOKUP(...) AS MyLookedUpField ... without referencing the lookup table in the FROM clause.


>Please enlighten anyone
>
>which do you use :
>
>Select * ;
> from parent,child ;
> where parent.key=child.key ;
> into cursor temp
>
>or
>
>Select * ;
> from parent ;
> join child on parent.key=child.key ;
> into cursor temp
>
>Can anyone recommend a very good book on the use of SQL-SELECT where there are very good or much better excellent examples on the use of nested select statements that span several child tables and span lookup tables in one SQL statement ???
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform