plusnplus Posted October 18, 2010 Share Posted October 18, 2010 Hi.., Is order by last x column possible in mysql query ? my query is like: select * from table1 order by col_a, col_b, col_c every month I need to change the order like: select * from table1 order by col_b, col_c,col_d because i add another column in the table. Quote Link to comment https://forums.phpfreaks.com/topic/216124-is-order-by-last-x-column-possible-in-mysql-query/ Share on other sites More sharing options...
Mchl Posted October 18, 2010 Share Posted October 18, 2010 If you need to add a new column to your table each month, something is seriously wrong with your database design. Database is not a spreadsheet. Please read this: http://dev.mysql.com/tech-resources/articles/intro-to-normalization.html Quote Link to comment https://forums.phpfreaks.com/topic/216124-is-order-by-last-x-column-possible-in-mysql-query/#findComment-1123323 Share on other sites More sharing options...
plusnplus Posted October 18, 2010 Author Share Posted October 18, 2010 If you need to add a new column to your table each month, something is seriously wrong with your database design. Database is not a spreadsheet. Please read this: http://dev.mysql.com/tech-resources/articles/intro-to-normalization.html So it is not possible to order by last x column in mysql query ? Quote Link to comment https://forums.phpfreaks.com/topic/216124-is-order-by-last-x-column-possible-in-mysql-query/#findComment-1123329 Share on other sites More sharing options...
Mchl Posted October 18, 2010 Share Posted October 18, 2010 No, it is not possible either in MySQL, or in any other SQL falvor that I know of. Quote Link to comment https://forums.phpfreaks.com/topic/216124-is-order-by-last-x-column-possible-in-mysql-query/#findComment-1123338 Share on other sites More sharing options...
fenway Posted October 18, 2010 Share Posted October 18, 2010 So it is not possible to order by last x column in mysql query ? What does that even mean? Quote Link to comment https://forums.phpfreaks.com/topic/216124-is-order-by-last-x-column-possible-in-mysql-query/#findComment-1123439 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.