yrrahxob Posted November 23, 2003 Share Posted November 23, 2003 I have the following query but it doesn\'t work. I get error code 1064. SELECT * FROM `aud_desc` order by substr(aud_code,1,1) Is it possible to do a select and order it by a substr of a column. Please help Thank you Quote Link to comment https://forums.phpfreaks.com/topic/1419-select-order-by-substr-of-a-field/ Share on other sites More sharing options...
Kriek Posted November 23, 2003 Share Posted November 23, 2003 In MySQL use the SUBSTRING() function. SELECT * FROM aud_desc ORDER BY SUBSTRING(aud_code, 1, 1); Quote Link to comment https://forums.phpfreaks.com/topic/1419-select-order-by-substr-of-a-field/#findComment-4695 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.