home / regmem

regmem

Custom SQL query

select people.id, people.name, count(*) as num_items, group_concat(item, ':::'), group_concat(date, ' : ') from items
join people on items.person_id = people.id
join categories on items.category_id = categories.id
where items.category_id in (
  -- All forms of shareholding
  "Aead2f460", "a5bbc519",  "3aff2389",
  "21983754",  "5b34324e",  "b1cf7e3e"
)
and items.rowid in (select rowid from [items_fts] where [item] match :search) 
group by items.person_id
order by num_items desc;

Query parameters

Powered by Datasette · Query took 0.715ms