SQLize Online / PHPize Online

A A A
Share   Donate   Blog   Popular
Copy Format Clear
CREATE TABLE test ( id serial, name varchar ); INSERT INTO test (name) values ('one'),('two'),('three'),('four'),('five'); CREATE FUNCTION welcome() RETURNS TEXT AS $$ DECLARE str TEXT := 'Hello, world!'; BEGIN RETURN str; END; $$ LANGUAGE plpgsql; SELECT welcome(); CREATE FUNCTION fact(n int) RETURNS int AS $$ DECLARE res int = 1; i int; BEGIN FOR i in 1..n LOOP res = res * i; END LOOP; RETURN res; END; $$ LANGUAGE plpgsql; SELECT fact(5);
Stuck with a problem? Need help? Ask professionals on our Telegram channel!
Join the channel
Your quersion is posted.
Join our Telegram channel and get answers.
Send
Copy