Re: AW: [PHP-DB] Order by multiple tables
| From: | Wico de Leeuw | Date: | Mon, 07 Aug 2000 13:51:25 +0000 |
| Subject: | Re: AW: [PHP-DB] Order by multiple tables | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-1830@lists.php.net to get a copy of this message | ||
At 15:49 7-8-2000 +0200, Simon Biela wrote:
Hi again! I don't know what I am doing wrong, but I get the following error: In table1, there are 10 entries. In table2 I can find 7 entries. As soon as I say: SELECT * FROM table1, table2Hiya Youre doing a joing with a shared key this confuses mysql you can't do a select * one 2 tables only with a where: select * from 1,2 where 1.id =2.id or something like that Greetz, Wico
MySQL returns 70 results. Is that right? mfG Simon -----Ursprüngliche Nachricht----- Von: Sam Masiello [mailto:smasiello@chekinc.com] Gesendet: Montag, 7. August 2000 15:06 An: Simon Biela; php-db@lists.php.net Betreff: RE: [PHP-DB] Order by multiple tables You might want to try using commas, instead of the AND keyword. Like this: SELECT ...FROM ...WHERE... .. .. ORDER BY table.field1, table.field2, table.field3 The AND keyword is not necessary. HTH Sam Masiello System Analyst Chek.Com (716) 853-1362 x289 smasiello@chekinc.com -----Original Message-----From: Simon Biela [mailto:s.biela@netdienste.de]Sent: Monday, August 07, 2000 8:30 AM To: php-db@lists.php.netSubject: [PHP-DB] Order by multiple tablesHi there! I'd like to SELECT from three tables and order the results by a column, which all three tables have. Here comes an example which won't work. Any help would be greatly appreciated. SELECT * FROM table1, table2, table3 ORDER BY table1.createdate AND table2.createdate AND table3.createdate The column "createdate" exists in all three tables. mfG Simon --- netdienste GbR internet & multimedia Geisselstrasse 19 50823 Koeln tel: +49 221 - 932 958 2 fax: +49 221 - 932 958 5 s.biela@netdienste.de http://www.netdienste.de linebreak - das redaktionssystem http://www.linebreak.de -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net For additional commands, e-mail: php-db-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net For additional commands, e-mail: php-db-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net For additional commands, e-mail: php-db-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net