SQLize Online / PHPize Online  /  SQLtest Online

A A A
Share      Blog   Popular
Copy Format Clear
create table t1 (id int, referer text); create table t2 (id int, referer text); create table t3 (id int, referer text); insert into t1 values (1, 'test'), (2, 'yandex'); insert into t2 values (10, 'test'), (20, 'yandex'); insert into t3 values (100, 'test'), (200, 'yandex'); SELECT GROUP_CONCAT('select "' || name || '" table_name, * from ' || name || ' where referer = "yandex"', ' union ') q FROM sqlite_master WHERE type ='table' AND name NOT LIKE 'sqlite_%'; select "t1" table_name, * from t1 where referer = "yandex" union select "t2" table_name, * from t2 where referer = "yandex";

Stuck with a problem? Got Error? Ask ChatGPT!

Copy Clear