Sybase SQL - Remove “semi-duplicates” from query results
问题 I have a query that uses two SELECT statements that are combined using a UNION ALL . Both statements pull data from similar tables to populate the query results. I am attempting to remove the "semi-duplicate" rows from the query, but am having issues doing so. My query is the following: SELECT DISTINCT * FROM ( SELECT TeamNum = CASE WHEN T.TeamName = 'Alpha Team' THEN '1' WHEN T.TeamName IN ('Bravo Team', 'Charlie Team') THEN '2' WHEN T.TeamName = 'Delta Team' THEN '3' ELSE '<Undefined>' END,