Last active
August 29, 2015 14:10
-
-
Save embayer/aca2114a98dffd0ba70e to your computer and use it in GitHub Desktop.
collection of useful sql statements
This file contains hidden or 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
-- find duplicated values | |
SELECT | |
address_line1, address_line2, zip, city, country, COUNT(*) | |
FROM | |
location | |
GROUP BY | |
address_line1, address_line2, zip, city, country | |
HAVING | |
COUNT(*) > 1; | |
-- show the average length of a column | |
SELECT | |
AVG(LENGTH(column1)) | |
FROM table1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment