Re: Order by multiple tables
| From: | Paul Gardiner | Date: | Mon, 07 Aug 2000 13:08:03 +0000 |
| Subject: | Re: Order by multiple tables | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-1825@lists.php.net to get a copy of this message | ||
Hi Simon,
> Hi 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
I don't know which DB you're using but it's usually:
ORDER BY table1.createdate,table2.createdate,table3.createdate
Commas instead of where you have AND.
Regards,
- Paul -
>
> 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
>
>
>