home / regmem


Custom SQL query

select people.id, people.name, count(*) as num_items, group_concat(item, ':::'), group_concat(hash, ' : '), 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 of the overseas trip categories
  '80ef1083', 'b634ef43', 'decaa699', 'd06ab996', 'f455437c',
  'da933c52', 'f52715fb', 'b30ee7b9', '8e53f3ff', '7c43f5eb',
and items.rowid in (select rowid from [items_fts] where [items_fts] match :search) 
group by items.person_id
order by num_items desc;

Query parameters

Powered by Datasette · Query took 0.702ms