Limit characters for mysql_query(select) lookup
Is there an efficient way to limit the number of characters for a mysql query lookup? So, if a text column field had 18000 characters, but I only need to query 500 characters, is t开发者_开发问答here a way to mysql_query("select text_column
from random_table
limit_char_count 500")?
How about using the SUBSTRING() function? Below example selects 4 characters starting from 1st position
SELECT SUBSTRING(text_column,1,4)
FROM random_table
WHERE something = something else
EDIT - edited based on - for all forms of SUBSTRING(), the position of the first character in the string from which the substring is to be extracted is reckoned as 1.
精彩评论