Home  >  Article  >  Database  >  mysql查询时截取字符串_MySQL

mysql查询时截取字符串_MySQL

WBOY
WBOYOriginal
2016-06-01 13:51:43831browse

SELECT substring_index( wantclass, ' ', 1 ) AS wclass FROM bd_resume WHERE user_id =42

wantclass为要截取字符串对应的字段名,

' '为要以什么为截取字符的关键字符

1为关键字符出现的位置

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn