Advertisement
Guest User

Untitled

a guest
Feb 23rd, 2019
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. ,CTE4 as
  2. (
  3. Select distinct *
  4. , case when [Dispatch_Part_Commodity_List] = ltrim(Rtrim([Original Order])) then 1 else 0 end as'Same Part Repeat'
  5. , case When isnull([Dispatch_Part_Commodity_List], '') = '' or isnull([Original Order], '') = '' then 1 else 0 end as 'Labor Only Repeat'
  6. , Case When [Dispatch_Part_Commodity_List] != ltrim(Rtrim([Original Order])) then 1 else 0 end as 'Non Original Order'
  7. , Case When [Dispatch_Part_Commodity_List] like Concat ('%',ltrim(Rtrim([Original Order])),'%') then 1 else 0 end as 'Standby Flag'
  8. from Dispatch_Map
  9. where Row_Count = 1
  10. )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement