At 12:57 +1100 3/7/04, Mark Beauman wrote:
I have 15 tables, all with the same column names (but different values) where i want to SELECT all rows over all tables but not to JOIN. Is there a way i can do this? I am sure I am missing something simple but cannot seem to find the answer in the manual, forums.

If they're MyISAM tables, you can define a MERGE table that spans them all. Then selecting from the MERGE table selects from the collection of tables.

You can use your LIMIT clause as well, as long as by that you don't mean
"5 most recent from *each* table".

http://www.mysql.com/doc/en/MERGE.html
http://www.mysql.com/doc/en/CREATE_TABLE.html



Furthermore i want to read the 5 most recently added results of which companydate holds the value.


Currently my code reads .....

SELECT disc_id, companyname, companyurl, companydate FROM table_1, table_2, table_3, table_4 ORDER BY companydate LIMIT 5


--
Paul DuBois, MySQL Documentation Team
Madison, Wisconsin, USA
MySQL AB, www.mysql.com

MySQL Users Conference: April 14-16, 2004
http://www.mysql.com/uc2004/

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to