Last active
January 23, 2017 13:53
-
-
Save atarkowska/82e33db682a6faafc41ed43c92dc290c to your computer and use it in GitHub Desktop.
query URLs
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 | |
count (distinct mv.value), mv.name, (substring(mv.value from '(https?://([^/]*){1})')) as url | |
FROM | |
annotation_mapvalue as mv | |
WHERE | |
(substring(mv.value from '(https?://([^/]*){1})')) is not null | |
GROUP BY mv.name, url | |
ORDER BY 2; |
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
idr=> SELECT | |
count(distinct mv.value), | |
sqname, | |
sqmv.url | |
FROM | |
annotation_mapvalue as mv | |
JOIN | |
( | |
SELECT | |
distinct ( substring(name from '(.*) URL') )as sqname, | |
(substring(sqmv.value from '(https?://([^/]*/){1})')) as url, | |
sqmv.annotation_id | |
FROM | |
annotation_mapvalue as sqmv | |
WHERE | |
sqmv.name like '%URL' | |
) AS sqmv ON sqmv.annotation_id = mv.annotation_id | |
WHERE | |
mv.name = sqname | |
group by | |
sqname, | |
sqmv.url | |
order by 2 ASC; |
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 count(ial.id) from annotation_mapvalue as mv | |
join annotation as a on (a.id=mv.annotation_id) | |
join imageannotationlink as ial on (ial.child=a.id) | |
where mv.value like 'CMPO_%’ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment