温馨提示×

instr函数mysql怎么写

九三
150
2021-03-03 18:52:44
栏目: 云计算
亿速云mysql数据库,读写分离,安全稳定,弹性扩容,低至0.3元/天!! 点击查看>>

instr函数mysql怎么写

instr函数在mysql中的用法

语法:

INSTR(str,substr)

注:

str:从哪个字符串中搜索

substr:要搜索的子字符串

sql语句如下:

# 将instr结果作为一列,并按其排序

select id,1 from world_guide where id = 32

union

select * from

(select id, instr('30,35,31,',id+',') as d from

world_blog where id in (30,35,31) order by d) as t;

亿速云「云数据库 MySQL」免部署即开即用,比自行安装部署数据库高出1倍以上的性能,双节点冗余防止单节点故障,数据自动定期备份随时恢复。点击查看>>

推荐阅读:instr sql函数怎么写

0