In Oracle I want to select 2 columns with multiple rows:
Example:
name Phone
---- -----
John 1234
Mary 4321
This doesn't work:
select
'John' as name,
'Mary' as name,
'1234' as phone,
'4321' as phone
from
dual
CodePudding user response:
Union together two single-row queries:
select
'John' as name,
'1234' as phone
from
dual
union all
select
'Mary' as name,
'4321' as phone
from
dual
NAME | PHONE |
---|---|
John | 1234 |
Mary | 4321 |