Suppose i have the following query
select 'a' as a, '' as b
union all
select '' as a, 'b' as b
The result set is :-
a ' '
' ', b
Now, i need a query that returns a single row with a result set like :-
a b
Suppose i have the following query
select 'a' as a, '' as b
union all
select '' as a, 'b' as b
The result set is :-
a ' '
' ', b
Now, i need a query that returns a single row with a result set like :-
a b
select 'a' as a, 'b' as b
This query is conform with what you asked, but I don't think it's what you're after.
Can you rephrase your question?
SELECT MAX(a) AS a, MAX(b) AS b
FROM (
select 'a' as a, '' as b
union all
select '' as a, 'b' as b
) AS table1