Bug #1748 | SELECT with LIMIT _AND_ UNION works incorrectly | ||
---|---|---|---|
Submitted: | 4 Nov 2003 9:03 | Modified: | 4 Nov 2003 9:16 |
Reporter: | Dirk Thomsen | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | MySQL Server | Severity: | S2 (Serious) |
Version: | 4.0.17b | OS: | Windows (Win) |
Assigned to: | CPU Architecture: | Any |
[4 Nov 2003 9:03]
Dirk Thomsen
[4 Nov 2003 9:16]
Dean Ellis
The final LIMIT is being applied to the entire result set. If you want to limit the individual queries, surround them with parentheses. ie: ( SELECT * FROM t1 LIMIT 2 ) UNION ALL ( SELECT * FROM t2 LIMIT 2 );