Hi James,

The simple answer would be that the syntax says:

http://www.mysql.com/doc/en/UNION.html

SELECT...
UNION...
SELECT...

And thats all there is to it ;-) ... perhaps...


Exception:

The only reason to use the parenthis would be with ORDER BY (as you do), but 
than you will need to use this also in each SELECT statement.



Best regards

Nils Valentin
Tokyo/Japan


2003年 8月 14日 木曜日 18:06、James Fryer さんは書きました:
> At 09:47 am 14/08/03, Jim Smith wrote:
> >But why do you need the parentheses?
>
> This was a simplified query for example purposes.
>
> The real query looks more like
>
>    (SELECT ...) UNION (SELECT ...) ORDER BY ...
>
> I could rewrite this with subselects but I have found them to be slower.
>
> My question is, why do the parentheses cause a syntax error and is this a
> bug?
>
> Jim
> --
> James Fryer  /  [EMAIL PROTECTED]  /  [EMAIL PROTECTED]

-- 
---
Valentin Nils
Internet Technology

 E-Mail: [EMAIL PROTECTED]
 URL: http://www.knowd.co.jp
 Personal URL: http://www.knowd.co.jp/staff/nils


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

Reply via email to