Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Joining Temp Tables with Priority ?
Message
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Miscellaneous
Thread ID:
00655244
Message ID:
00655258
Views:
30
This message has been marked as the solution to the initial question of the thread.
I'm not sure what is "priority" in this case. The following query will eliminate batches from subsequent temp tables that already exist in previous temp. tables
Select * From #TTCompletePoint
Union All
Select * From #TTComplete
  Where iBatchID Not In (Select * From #TTCompletePoint)
Union All
Select * From #TTFailed
  Where iBatchID Not In (Select * From #TTCompletePoint)
    And iBatchID Not In (Select * From #TTComplete)
Union All
Select * From #TTInprocess
  Where iBatchID Not In (Select * From #TTCompletePoint)
    And iBatchID Not In (Select * From #TTComplete)
    And iBatchID Not In (Select * From #TTFailed)
>I have four seperate queries and want to join them into a single result set, giving the first result set priority over the first. Can anyone help?
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform