Skip to content

Instantly share code, notes, and snippets.

attach 'props.db' as props;
select type, count(type) as cnt, l.value
from relations r
join props.labels l on r.type=l.property
group by type, l.value
order by cnt desc
limit 200;
BEGIN { LETTERS = "abcdefghijklmnopqrstuvwxyz" }
{
len = length($0);
if (len == 5) {
for (i = 1; i <= len; i++) {
c = substr($0, i, 1);
ltr = index(LETTERS, c);
if (ltr > 0) {