clear markdown compare help best fiddles feedback dbanow.uk a leap of faith?
clear markdown donate comments/suggestions/bugs a leap of faith? bible365 diddy dollings
By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0. 1228811 fiddles created (16681 in the last week).

create table one (id integer, data text);
 hidden batch(es)


create table two (id integer, some_content text);
 hidden batch(es)


insert into one values (1, 'some data'), (2, 'foo data');
2 rows affected
 hidden batch(es)


insert into two values (100, 'value foo'), (200, 'other data');
2 rows affected
 hidden batch(es)


with found_rows as ( select table_name, query_to_xml(format($$ select to_jsonb(t) as table_row from %I.%I as t where t::text like '%%foo%%' $$, table_schema, table_name), true, false, '') as table_rows from information_schema.tables where table_name in ('one', 'two') ) select table_name, x.table_row from found_rows f left join xmltable('//table/row' passing table_rows columns table_row text path 'table_row') as x on true
table_name table_row
one {"id": 2, "data": "foo data"}
two {"id": 100, "some_content": "value foo"}
 hidden batch(es)