I believe that this is how you would do it. You will have to test it. select date,qty,product,client from table1 where month(date)=5 union all select date,qty,product,client from table2 where month(date)=5 order by client into table temp
Sytze de Boer wrote: > I THINK you've addressed my question. So how would you put this into one > line ? > (the union all clause) > > > On Fri, May 16, 2008 at 8:15 AM, MB Software Solutions General Account < > [EMAIL PROTECTED]> wrote: > >> Sytze de Boer wrote: >>> I'm sure this is a simple one for most of you >>> >>> I have 2 (or more) free standing tables >>> table1=current data >>> table2=history data >>> The structure of both tables is identical >>> >>> I now want to do something like >>> select date,qty,product,client from table1 where month(date)=5 order by >>> client into table temp >>> >>> But I want this from BOTH table1 and table2 >>> >>> Can this be done in ONE select statement ? >>> >> >> Perhaps I'm missing something, but why not use UNION ALL the 2 SQL-SELECTs? >> >> [excessive quoting removed by server] _______________________________________________ Post Messages to: [email protected] Subscription Maintenance: http://leafe.com/mailman/listinfo/profox OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech Searchable Archive: http://leafe.com/archives/search/profox This message: http://leafe.com/archives/byMID/profox/[EMAIL PROTECTED] ** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.

