Hi! Could we please enable some services and cookies to improve your experience and our website?

SQLize | PHPize | SQLtest

Online Sandbox for SQL and PHP: Write, Run, Test, and Share SQL Queries and PHP Code

A A A
Login    Share code      Blog   FAQ
Copy Format Clear
create table t1 as select n as id, md5(n::text) as txt from generate_series(1, 10) s(n); create table t2 as select n as id, md5((n + 100)::text) as txt from generate_series(1, 10) s(n); create function func_test() returns table (id int, txt text, txt2 text) language plpgsql as $$ declare qry text; begin qry := $q$select t1.*, t2.txt as txt2 from t1 join t2 using(id)$q$; return query execute qry; end; $$; select * from func_test();

Stuck with a problem? Got Error? Ask AI support!

Copy Clear