s0c0 Posted May 18, 2007 Share Posted May 18, 2007 I am looking for a query a that will allow me to select all where charecter length in a given column is greater than 5. I ahve tried the following: SELECT * FROM tbl WHERE CHAR_LENGTH(col) > 5; But mysql returns an error near CHAR_LENGTH. Any ideas? Quote Link to comment https://forums.phpfreaks.com/topic/52059-select-where-character-length-is-greater-than/ Share on other sites More sharing options...
bubblegum.anarchy Posted May 18, 2007 Share Posted May 18, 2007 The query looks fine syntactically, maybe the tbl prefix is an issue... try again with the table name and column names wrapped in backticks: SELECT * FROM `tbl` WHERE CHAR_LENGTH(`col`) > 5; Quote Link to comment https://forums.phpfreaks.com/topic/52059-select-where-character-length-is-greater-than/#findComment-256712 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.