Hi list

environment:

host:/ # uname -a
Linux host 2.4.19-4GB #1 Fri Sep 13 13:14:56 UTC 2002 i686 unknown
host:/ #

host:/ # /usr/local/mysql/bin/mysqld -v
/usr/local/mysql/bin/mysqld  Ver 4.0.12-max for pc-linux on i686
host:/ #


an php application of ours prepares customer data on the screen in a normal way:


select name, b, c from tabx left outer join taby on tabx.cx = taby.cy where tabx.name like "%username%" order by tabx.cx;

this works fine and incredibly fast and the output suits the needs of our cusstomers.

now, customers keep telling me that they would like to have a printed output of their screen-lists. and they would very much prefer that the printed output were ordered by tabx.name, and - of course - that they have exactly the same data on the screen as later on paper.

if i just change the "order by" clause, i will usually not have the same data on the screen like on the paper.

i can do it with a temporary table:

mysql> drop temporary table if exists temptab;

mysql> create temporary table temptab select name, b, c, d from tabx where name like "%username%" order by tabx.cx;

mysql> select * from temptab order by name;

that gave the customers the same data on paper like on the screen, and the paper data are ordered by name

ONLY THAT i must give alle customers "create-temporay-table" rights, and this is not exactly, what i want.

can i do this another way round, i.e. without going through a temporary table?

i thought about using a table alias an do a union, but the table alias is not known any more in the second statement of the union.

i also tried to google but the situation cannot be explained in two words which would probably lead to a google-success.

you might tell me, that i could do the same select and afterwards sort the result using php-sort. that is neither what i want because our customers are used to the incredible speed of mysql.

any suggestion is very much appreciated.

thanks in advance

suomi

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



Reply via email to