Bug #34439 Order by clause in view
Submitted: 8 Feb 2008 23:44 Modified: 9 Feb 2008 13:27
Reporter: tariq rahiman Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server: Views Severity:S3 (Non-critical)
Version:6.0.0 OS:Any (Order by clause in view)
Assigned to: CPU Architecture:Any
Tags: Order by clause in view

[8 Feb 2008 23:44] tariq rahiman
Description:
Created two tables and created a view with union clause.
The order by doesnt have any effect and can take in any junk text.

How to repeat:
Create table emp1 (id int);

Create table emp2 (id int);

CREATE VIEW view_tariq AS
(SELECT *  FROM test.emp1) union (SELECT *  FROM test.emp2 ) order by this_is_dumb;
[9 Feb 2008 13:27] MySQL Verification Team
Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://dev.mysql.com/doc/ and the instructions on
how to report a bug at http://bugs.mysql.com/how-to-report.php

http://dev.mysql.com/doc/refman/6.0/en/create-view.html

"ORDER BY is allowed in a view definition, but it is ignored if you select from a view using a statement that has its own ORDER BY"