NutzCN Logo
问答 查询条件,从1001到1009 这种字符串类型,应该怎么拼?
发布于 2562天前 作者 qq_d6d46f6d 1931 次浏览 复制 上一个帖子 下一个帖子
标签:

如题,我的想法是先用截取,然后循环拼出来全部的字符串list,然后用in来做条件。
觉得很笨拙,想知道有啥好办法

4 回复

mysql的话

select * from t_user where nm > "1000" and nm < "1010"

如果包含两端,可以用between。

这两种都可以

select * from card where txt_card_code >= '10086' and txt_card_code <= '10089' 

select * from card where txt_card_code  BETWEEN  '10086' and '10089'
添加回复
请先登陆
回到顶部