Using the GROUP BY clause

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

version 11


We would like to get some information about the number of tickets sold each year starting with 1979. The result will be sorted by year.

To do this, we must total all the tickets sold for every movie in each year more recent than 1979, and then sort the result by year.

The initial query in 4D code would be:

Using the SQL code, the above query becomes:

Using generic SQL commands, the above query becomes:

Using the QUERY BY SQL command, the above query becomes:

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 GROUP BY clause button.


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