I’m able to create the table using CTE with select statement like below but it’s not behaving like I want.
with sorting(item_code, index) as (
select (10001, 1), (10002, 2)
)
select * from sorting
Table result :
item_code|index |
---------+---------+
(10001,1)|(10002,2)|
Basically I want to create table with value like this :
item_code | index
10001 | 1
10002 | 2
How could I do that using SQL?
2
Answers
you can try this:
This is most probably what you want using the
values
clause