Last active
August 29, 2015 14:01
-
-
Save rsimon/2c050ba033e2f6881d91 to your computer and use it in GitHub Desktop.
Getting top unidentified places from Recogito DB
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
SELECT | |
-- concat (toponym, toponym_corrected), count(*) | |
coalesce(toponym, toponym_corrected), count(*) | |
FROM annotations WHERE | |
(status = 'NOT_IDENTIFYABLE' OR status = 'NO_SUITABLE_MATCH' OR status = 'AMBIGUOUS' OR status = 'MULTIPLE') | |
-- GROUP BY concat(toponym, toponym_corrected) | |
GROUP BY coalesce(toponym, toponym_corrected) | |
ORDER BY count desc ; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
As Hugh Cayless has pointed out:
In any case, the answer is probably the COALESCE() function instead of CONCAT()
Thanks again!