The set of all distinct rows from two or more result sets.

learn more… | top users | synonyms

2
votes
2answers
1k views

Postgres 9.2 select multiple specific rows in one query

I have a table with three columns, Id Serial. Value real. timein Timestamp. I want to select the values based on a range of days ie. from two days ago until now. The table may contain one or two ...
0
votes
3answers
61 views

Is there a faster way to get UNION ALL behavior in Postgres?

I have a table (t0), in my Postgres DB, with data that looks something like this: t1_id t2_id 1 1 2 1 2 1 4 null 4 null 5 null And I have a query to return my ...
1
vote
1answer
2k views

MySQL - SELECT INTO OUTFILE, with a UNION

Is it possible to issue multiple select queries whose resultsets are combined via union, into the same outfile? What I am trying to do, but not working: (SELECT email FROM table WHERE createdate ...
2
votes
1answer
928 views

Best practice: Unions or a derived table?

I've inherited a medium-sized database with a terrible schema. The sanitized portion in question is like so: CREATE TABLE `pending` ( ... `invoice` int(11) DEFAULT NULL, `lid` int(11) DEFAULT ...