Reputation:
for example,
select 1,2,3 ;
will return 3 columns with 1 row i.e [1,2,3]
, So how to get 3 coulmns with 3 rows with the same content ?
Upvotes: 2
Views: 1395
Reputation: 21915
Try UNION, I think you need something like this
select 1 c1,2 c2,3 c3
union all
select 1 ,2 ,3
union all
select 1 ,2 ,3
Upvotes: 0
Reputation: 22885
Well, CROSS JOIN
is a good fit here:
SELECT rownum, cols.*
FROM (SELECT 1,2,3) cols
CROSS JOIN generate_series(1,10) id(rownum);
You use SELECT cols.*
if you need just values without row numbers.
Upvotes: 1