Skip to content

Instantly share code, notes, and snippets.

@Djaxis
Created September 21, 2020 20:04
Show Gist options
  • Save Djaxis/ba83f2b8e5ddb5159e556078470c215f to your computer and use it in GitHub Desktop.
Save Djaxis/ba83f2b8e5ddb5159e556078470c215f to your computer and use it in GitHub Desktop.
MY SQL #Condition Manipulation de BDD
#condition de sorciers nées entre 1975 et 1985
Select birthday FROM wizard
WHERE birthday BETWEEN '1975-01-01' AND '1985-01-01';
#condition prénom commencant par H
Select firstname FROM wizard
WHERE firstname LIKE "H%";
#condition Nom de famille Potter par ordre alphabétique
Select firstname, lastname FROM wizard
WHERE lastname="Potter"
ORDER BY firstname ASC;
#condition du plus vieux
SELECT firstname, lastname , birthday
FROM wizard
ORDER BY birthday ASC
LIMIT 1; # donne mois seulement la première sortie
#Toutes les conditions reunni en seul code
SELECT firstname, birthday, lastname FROM wizard
WHERE firstname LIKE "H%"
AND birthday between '1975-01-01' AND '1985-01-01'
ORDER BY lastname;
@Djaxis
Copy link
Author

Djaxis commented Sep 22, 2020

BIRTHDAY BETWEEN

@Djaxis
Copy link
Author

Djaxis commented Sep 22, 2020

Uploading LIMIT 1.jpg…

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment