55问答网
所有问题
当前搜索:
sql语句包含某些数字
如何
用sql
查询某值类型字段各个记录中
含有
的特定
数字
?
答:
假说表结构为图片SELECT * FROM [11]where CHARINDEX('27',convert(int,[字段1]))>0结果:27121202712350
sql语句
查询字段中
包含某个数字
的列信息
答:
select * from 表 where ','+列4+',' like('%,2,%')一般情况下,像这种序列填充列,在设计时不会在列中的前后加逗号,可能的数据:2 或者 2,22 又或者 0,1,2 所以一般放在查询中人为的给列值前后加逗号,再模糊匹配.
sql语句
查询字段中
包含某个数字
的列信息
答:
select * from info where (',' + id + ',') like ('%,' + '9' +',%')
sql
查询数字记录中存在
某个数字
答:
select * from info where (',' + id + ',') like ('%,' + '9' +',%')
写一个
sql语句
,插入1,2,3这三个
数字
答:
insert 表名(字段名)Values(所加内容) ---这个是没有新增的 update 表名 set 字段名=修改内容 where 条件 ---个有是已有数据修改的
SQL
中如何查询字段中是否
包含
指定
数字
?
答:
where条件这样写试试 where num like '1,%' or num like '%,1,%' or num like '%,1'
数据库
SQL语句
:将电话号码这一列里面按照所含
数字
6的个数分类,如含1个...
答:
select 电话号码,case when 电话号码 ='6666666' then 1 when 电话号码 like '%6%6%6%6%6%6%' then 2 when 电话号码 like '%6%6%6%6%6%' then 3 when 电话号码 like '%6%6%6%6%' then 4 when 电话号码 like '%6%6%6%' then 5 when 电话号码 like '%6%6%' then 6 when 电话号码 ...
sql语句
中对一个字段排序,字段中
含有
字符串和
数字
,(怎根据数字进行排序...
答:
order by 字段名称+0 desc/asc的形式进行排序 order by 字段名称*1 desc/asc的形式进行排序
求
sql语句
,查询int型字段中
包含数字
8的记录
答:
tablename where haoma like '%8%8%8%';select haoma as 二等奖 from tablename where haoma like '%8%8%' and haoma not like '%8%8%8%';select haoma as 三等奖 from tablename where haoma like '%8%' and haoma not like '%8%8%' and haoma not like '%8%8%8%';...
SQL
里想查出一个表中一列里包涵某2个
数字
的
语句
。
答:
select * from tablename where columnname like '%57%'
sql
server select * from tablename where charindex('57',columnname ) > 0
1
2
3
4
5
6
7
8
9
10
涓嬩竴椤
灏鹃〉
其他人还搜
sql语句查找包含某些数字
sql某个字段包含某个值
sql判断字段是否有某个值
sql包含字的列
sql字段包含集合里的元素
查询某个字段包含某个值
sql语句求和
sql语句包含条件的写法
sql怎么查看字段有哪些值