ORDERing two UNION queries: Non-Subquery UNION Execution

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



http://dev.mysql.com/doc/internals/en/select-union.html

Does anyone know what this means? Can it be implemented in the flow of php code without explicitly creating temp tables in the database?

My query is like:

$query = "
       (SELECT
       Table.field, [other fields]
       FROM Table [other JOINs]
       ORDER BY Table.field
       )
       UNION
       (SELECT
       Table2.field, [other fields]
       FROM Table2 [other JOINs]
       ORDER BY Table2.field
       )
       ";

and I want the ORDER to apply to the whole UNIONed result.

John

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux