Reputation: 4437
I need to retrieve this result:
ROW1.id | ROW2.id | ROW3.id | ROW4.id
1 | 2 | 3 | 4
starting from this result select * from Table
:
id | value
1 | sample1
2 | sample2
3 | sample3
4 | sample4
any idea?
thanks, Andrea
Upvotes: 1
Views: 278
Reputation: 3697
you can do something like that:
select
(select id from table X where X.something = 123) as row1Id,
(select id from table X where X.something = 456) as row2Id,
(select id from table X where X.something = 789) as row3Id
Upvotes: 1