If you have MySQL 4, you can use a UNION.
Otherwise you'll need a second table, because what you want is not
a join, but a concatenation of result sets.

At 12:47 -0500 5/6/02, Jay Blanchard wrote:
>Here is a puzzler for SQL jockies on a Monday afternoon. I have 2 tables,
>each with what may or may not be a unique range of dates;
>
>tblDate1
>+--------+------------+
>| field1 | rDate      |
>+--------+------------+
>|      1 | 2002-03-01 |
>|      2 | 2002-03-03 |
>|      3 | 2002-03-05 |
>|      4 | 2002-03-07 |
>+--------+------------+
>
>tblDate2
>+--------+------------+
>| field1 | rDate      |
>+--------+------------+
>|      1 | 2002-03-02 |
>|      2 | 2002-03-04 |
>|      3 | 2002-03-06 |
>|      4 | 2002-03-08 |
>|      5 | 2002-03-07 |
>+--------+------------+
>
>I need a SQL query that returns these as one column with no duplicates,
>preferably without having to create a temp table by doing an INSERT
>....SELECT
>+------------+
>| rDate      |
>+------------+
>| 2002-03-01 |
>| 2002-03-02 |
>| 2002-03-03 |
>| 2002-03-04 |
>| 2002-03-05 |
>| 2002-03-06 |
>| 2002-03-07 |
>| 2002-03-08 |
>+------------+
>
>Has anyone done this before?
>
>Jay


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to