Top "Union" questions

Use this tag only for questions about UNION, a keyword of the SQL language for combining the results of multiple SQL queries.

SELECT INTO USING UNION QUERY

I want to create a new table in SQL Server with the following query. I am unable to understand why …

sql sql-server tsql union derived-table
SQL Server: How to use UNION with two queries that BOTH have a WHERE clause?

Given: Two queries that require filtering: select top 2 t1.ID, t1.ReceivedDate from Table t1 where t1.Type = 'TYPE_1' …

sql-server union where-clause
Group by with union mysql select query

(SELECT COUNT(motorbike.`owner_id`) as count,owner.`name`,transport.`type` FROM transport,owner,motorbike WHERE transport.type='motobike' AND …

mysql sql group-by union
Hibernate Union alternatives

What alternatives do I have to implement a union query using hibernate? I know hibernate does not support union queries …

java sql hibernate union
Using union and count(*) together in SQL query

I have a SQL query, looks something like this: select name, count (*) from Results group by name order by name …

sql union
How to execute UNION without sorting? (SQL)

UNION joins two results and remove duplicates, while UNION ALL does not remove duplicates. UNION also sort the final output. …

sql union distinct union-all
How can I get the intersection, union, and subset of arrays in Ruby?

I want to create different methods for a class called Multiset. I have all the required methods, but I'm unsure …

ruby union intersection subset
SQL: how to use UNION and order by a specific select?

I have two selects: SELECT id FROM a -- returns 1,4,2,3 UNION SELECT id FROM b -- returns 2,1 I'm receiving correct …

sql oracle select union
Simplest way to form a union of two lists

What is the easiest way to compare the elements of two lists say A and B with one another, and …

c# .net linq list union
Merge two rows in SQL

Assuming I have a table containing the following information: FK | Field1 | Field2 ===================== 3 | ABC | *NULL* 3 | *NULL* | DEF is there a way …

sql join union