• Got a Tipila, google, windows live or facebook account ?

Here's how to do a union query with an order by clause

SELECT * FROM (SELECT TOP 1 StartDate FROM dbo.ExportStatus WHERE PubSurveyVersion = @PublicationId ORDER BY StartDate DESC) t1
UNION 
SELECT * FROM (SELECT TOP 1 QueuedTime FROM dbo.ExportQueue WHERE PubSrvId = @PublicationId ORDER BY QueuedTime DESC) t2
1
votes
Login to Tipila