Joins

4D - Documentation   Français   English   German   Japanese   4D SQL Reference, Table of Contents   4D SQL Reference, Index   Back   Previous   Next

version 11


We would now like to find out the city of birth for each actor. The list of actors is in the ACTORS table and the list of cities is in the CITIES table. To execute this query we need to join the two tables: ACTORS and CITIES.

The initial query in 4D code would be:

Using SQL code, the above query becomes:

Using generic SQL commands, the above query becomes:

Using the QUERY BY SQL command, we are unable to carry out the query above because it is not possible to pass more than one table as the first parameter.

Using the SQL EXECUTE IMMEDIATE command, the query above becomes:

To test all the above examples, launch the "4D SQL Code Samples" database and go to the main window. You can then choose the query mode and press the Joins button.


4D - Documentation   Français   English   German   Japanese   4D SQL Reference, Table of Contents   4D SQL Reference, Index   Back   Previous   Next