re: Re: SELECT rows from multiple tables and order all by last added
On Tuesday 10 December 2002 11:32, Angus Fraser wrote: > Thankyou Egor > > Sorting by the auto_increment_column does return rows in the order they > were added but I cant get it to do it for two tables. DATETIME or TIMESTAMP column contains the time row was inserted. > UNION may work but I am running ver 3.23.53a so UNION is not available is > there another way to do this in SQL or is it a job for the PHP code to sort > the results of two queries? Use temporary tables. -- For technical support contracts, goto https://order.mysql.com/?ref=ensita This email is sponsored by Ensita.net http://www.ensita.net/ __ ___ ___ __ / |/ /_ __/ __/ __ \/ /Egor Egorov / /|_/ / // /\ \/ /_/ / /__ [EMAIL PROTECTED] /_/ /_/\_, /___/\___\_\___/ MySQL AB / Ensita.net <___/ www.mysql.com - 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
Re: SELECT rows from multiple tables and order all by last added
Thankyou Egor Sorting by the auto_increment_column does return rows in the order they were added but I cant get it to do it for two tables. UNION may work but I am running ver 3.23.53a so UNION is not available is there another way to do this in SQL or is it a job for the PHP code to sort the results of two queries? Thanks list for your patience. Angus - Original Message - From: "Egor Egorov" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, December 10, 2002 3:57 AM Subject: re: SELECT rows from multiple tables and order all by last added > On Monday 09 December 2002 13:23, Angus Fraser wrote: > > > Hi, I've joined this list today - looking for a good forum to discuss my > > difficulties with Mysql as they arise - I'm an SQL newbie. > > > > I'd like to construct a single query that creates one list of the contents > > of multiple tables (which all have a "dateadded" column) sorted so that > > output rows from each table are listed in the order they were added to the > > DB. Is this possible? > > You can use f.e. auto_increment column and do > SELECT .. ORDER BY auto_increment_column; > > > I dont think it's a JOIN because the tables are not > > related in any way? > > If I've got you right, UNION is what you need: > http://www.mysql.com/doc/en/UNION.html > > > > -- > For technical support contracts, goto https://order.mysql.com/?ref=ensita > This email is sponsored by Ensita.net http://www.ensita.net/ >__ ___ ___ __ > / |/ /_ __/ __/ __ \/ /Egor Egorov > / /|_/ / // /\ \/ /_/ / /__ [EMAIL PROTECTED] > /_/ /_/\_, /___/\___\_\___/ MySQL AB / Ensita.net ><___/ www.mysql.com > > > > > - > 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 > > - 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
re: SELECT rows from multiple tables and order all by last added
On Monday 09 December 2002 13:23, Angus Fraser wrote: > Hi, I've joined this list today - looking for a good forum to discuss my > difficulties with Mysql as they arise - I'm an SQL newbie. > > I'd like to construct a single query that creates one list of the contents > of multiple tables (which all have a "dateadded" column) sorted so that > output rows from each table are listed in the order they were added to the > DB. Is this possible? You can use f.e. auto_increment column and do SELECT .. ORDER BY auto_increment_column; > I dont think it's a JOIN because the tables are not > related in any way? If I've got you right, UNION is what you need: http://www.mysql.com/doc/en/UNION.html -- For technical support contracts, goto https://order.mysql.com/?ref=ensita This email is sponsored by Ensita.net http://www.ensita.net/ __ ___ ___ __ / |/ /_ __/ __/ __ \/ /Egor Egorov / /|_/ / // /\ \/ /_/ / /__ [EMAIL PROTECTED] /_/ /_/\_, /___/\___\_\___/ MySQL AB / Ensita.net <___/ www.mysql.com - 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
SELECT rows from multiple tables and order all by last added
Hi, I've joined this list today - looking for a good forum to discuss my difficulties with Mysql as they arise - I'm an SQL newbie. I'd like to construct a single query that creates one list of the contents of multiple tables (which all have a "dateadded" column) sorted so that output rows from each table are listed in the order they were added to the DB. Is this possible? I dont think it's a JOIN because the tables are not related in any way? Thanks for your help. Angus Fraser - 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