Groups | Blog | Home
all groups > sql server reporting services > october 2006 >

sql server reporting services : Using UNION in MS SQL vs Oracle


Peter Manse
10/26/2006 3:31:02 PM
In SQL, this works beautifully:

SELECT 'All' AS RootName, ' All' AS SortValue
UNION
SELECT DISTINCT RootName, RootName AS SortValue
FROM dbo.APP_OnlineReportingRoots
ORDER BY SortValue

It adds the word "All" to both the RootName ans SortValue columns of the
results which I then use for a report parameter.

I have not been able to get it to work with Oracle. Does anyone know
Reeves Smith
11/22/2006 2:03:02 PM
Peter,

add "FROM dual" to the end of your select statement as Oracle does not
support the SELECT statement without a FROM clause.

SELECT 'All' AS RootName, ' All' AS SortValue FROM dual
UNION
SELECT DISTINCT RootName, RootName AS SortValue
FROM dbo.APP_OnlineReportingRoots
ORDER BY SortValue

AddThis Social Bookmark Button