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 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); 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
Archived
This topic is now archived and is closed to further replies.