Linux 拨号vps windows公众号手机端

instr函数mysql怎么写

lewis 7年前 (2018-10-14) 阅读数 11 #VPS/云服务器
文章标签 instrmysql函数

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;

版权声明

本文仅代表作者观点,不代表米安网络立场。

发表评论:

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。

热门