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.

Python set Union and set Intersection operate differently?

I'm doing some set operations in Python, and I noticed something odd.. >> set([1,2,3]) | set([2,3,4]) set([1, 2, 3, 4]) >> set().…

python set union intersection
a simple way to sum a result from UNION in MySql

I have a union of three tables (t1,t2,t3). Each rerun exactly the same number of records, first column …

sql mysql union
UNION the results of multiple stored procedures

I have a stored procedure I need to call several different times passing in different paramaters each time. I would …

sql sql-server stored-procedures union
Select distinct values from multiple columns in same table

I am trying to construct a single SQL statement that returns unique, non-null values from multiple columns all located in …

sql distinct union
UNION query with codeigniter's active record pattern

How to do UNION query with PHP CodeIgniter framework's active record query format?

mysql sql codeigniter activerecord union
ActiveRecord Query Union

I've written a couple of complex queries (at least to me) with Ruby on Rail's query interface: watched_news_posts = …

ruby-on-rails activerecord union active-relation
How do you UNION with multiple CTEs?

How do you use UNION with multiple Common Table Expressions? I'm trying to put together some summary numbers but no …

sql-server union common-table-expression
SELECT data FROM two tables in MySQL

What I have: The next structure: table_zero -> id (PRIMARY with auto increment) -> other table_1 -&…

mysql select union database-table
Combining UNION and LIMIT operations in MySQL query

I have a Jobs and a Companies table, and I want to extract 20 jobs that meet the following criteria: Jobs …

mysql sql union limit
MYSQL UNION DISTINCT

I have two selects that I'm currently running as a UNION successfully. (SELECT a.user_id, a.updatecontents AS city, …

mysql left-join union distinct