SQL question, DISTINCT returned values in multiple UNION ALL'ed statements -


I have a SQL statement that is a union of many queries that return everything:

  select key as select key from the table where XYZ union selects all the keys from the table as the DISTINCT id where the XYZ union all ... My question is that there are some questions that the key comes back overlap , And I really want the last key field to be different Bring back the looking values Any ideas? 

Use UNION instead of UNION ALL.


Comments

Popular posts from this blog

c++ - Linux and clipboard -

What is expire header and how to achive them in ASP.NET and PHP? -

sql server - How can I determine which of my SQL 2005 statistics are unused? -