Noticed something interesting about UNION and INTO OUTFILE

If I do this:

(SELECT a FROM b)
UNION
(SELECT a INTO OUTFILE 'out.txt' FROM c);

The query executes - no results printed to the screen but rather saved to the out.txt 
file, as intended.  But if I do:

(SELECT a FROM b)
UNION
(SELECT a INTO OUTFILE 'out.txt' FROM c)
ORDER BY a;

The query works but the results only print out to screen and do not get dumped into 
out.txt.  Actually nothing gets dumped to out.txt.

moving the INTO OUTFILE is invalid syntax:

(SELECT a FROM b)
UNION
(SELECT a FROM c)
INTO OUTFILE 'out.txt' 
ORDER BY a;

Is this normal/intentional?

MySQL 4.0.20 on Debian Linux.

Josh

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

Reply via email to