mysql_query(select) 查找的限制字符
有没有一种有效的方法来限制 mysql 查询查找的字符数?那么,如果一个文本列字段有18000个字符,但我只需要查询500个字符,有没有办法 mysql_query("select text_column
from random_table
limit_char_count 500") ?
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 there a way to mysql_query("select text_column
from random_table
limit_char_count 500")?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用 SUBSTRING() 函数怎么样?
下面的示例选择从第一个位置开始的 4 个字符
EDIT - 编辑基于 - 对于所有形式的 SUBSTRING(),要从中提取子字符串的字符串中第一个字符的位置被视为 1。
How about using the SUBSTRING() function?
Below example selects 4 characters starting from 1st position
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.