Last active
April 7, 2019 22:19
-
-
Save sqldeployhelmet/fbf51b36bb0775444d6564f337e1667d to your computer and use it in GitHub Desktop.
Using simple mathematical operators for filters in SQL
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* films with exactly 2 oscar nominations */ | |
SELECT name, releaseDate | |
FROM films | |
WHERE oscarNoms = 2; | |
/* films with more than 4 oscar nominations*/ | |
SELECT name, releaseDate | |
FROM films | |
WHERE oscarNoms > 4; | |
/* films with 6 or less oscar nominations*/ | |
SELECT name, releaseDate | |
FROM films | |
WHERE oscarNoms <= 6; | |
/* films with any number of oscar nominations except 3 */ | |
SELECT name, releaesDate | |
FROM films | |
WHERE oscarNoms <> 3; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment