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;
辰迅云「云服务器」,即开即用、新一代英特尔至强铂金CPU、三副本存储NVMe SSD云盘,价格低至29元/月。点击查看>>
推荐阅读: mysql创建数据库的代码如何写