Tableless Query for Postgres
This kind of query may useful for unit testing.
Query 1: This is working for most SQL
SELECT 'Anto' as name, 12 as age
UNION SELECT 'Linda', 9
UNION SELECT 'Mike', 10
FROM (values ('Anto', 12),('Linda', 9), ('Mike', 10) ) AS q (name, age)
Query 3: Single column with a lot of data
SELECT id FROM regexp_split_to_table('1,2,3,4,5,7,8,9', ',') AS id
Query 4: To expect more seconds for the query.
pg_sleep usually used at blind SQL injection.
SELECT 1 as id, pg_sleep(10)
Previously published in https://imantung.github.io at 15 Sep 2017