[Impressum/Imprint] | [Kontakt/Contact Me] |
Here is an easy example:
SELECT personID, lastname, firstname, birthdate, birthplace FROM tng_people WHERE lastname LIKE "M%" ORDER BY lastname, firstname, birthdatetr;
This SQL statement gives a list of a people having last names starting with "M".
Explanation | |
SELECT | |
personID, lastname, firstname, birthdate, birthplace | Names of the data fields we want to see. Each data field gives a column in the resulting table. |
FROM | |
tng_people | The database table where data coming from. |
WHERE | |
lastname LIKE "M%" | We don't want to see all data – we want only the data according to this condition (last names beginning with "M"). |
ORDER BY | |
lastname, firstname, birthdatetr | the data fields to get the resulting table sorted |
; | each SQL statement ends with a semicolon. |
Modify this example on our own and see what happens!