Information générale
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
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 ???
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement