Home > Database > Mysql Tutorial > body text

mysql查询时截取字符串_MySQL

WBOY
Release: 2016-06-01 13:51:43
Original
868 people have browsed it

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

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

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

1为关键字符出现的位置

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template