Tag Archives : mysql error Solution

Incorrect usage of UNION and ORDER BY

Incorrect usage of UNION and ORDER BY

Incorrect usage of UNION and ORDER BY A common problem when using the UNION command in MySQL is when you want to order the sets of data differently. If you do it incorrectly, you will see the error message: Incorrect usage of UNION and ORDER BY To solve the problem, wrap each individual SELECT statement in parenthesis as follows: (SELECT col1,col2,col3 FROM table1) UNION (SELECT cola,colb,colc FROM [...]
© 2010 Programming online. All rights reserved.
Weboy
freshlife WordPress Themes Theme Junkie