MySql语句------------------更新

1 篇文章 0 订阅

--查询多个id--
select * from t_wiki where id in (1486,1487,1488,1489,1490,1491,1492)
--查询标题为空(不为空)的数据--
select * from jz_know where title is null (is not null)
--id在多少和多少之间--
select * from jz_know where id between 100 and 200
--查询字符串--
SELECT * FROM jz_know  WHERE title  =  '钢笔'
SELECT * FROM jz_know  WHERE title like '钢笔%'  钢笔fdsfsa
SELECT * FROM jz_know  WHERE title like '%钢笔'  fdasfsd钢笔
SELECT * FROM jz_know  WHERE title like '%钢笔%'
--查询日期型数据--
select * from jz_know where e_save='2016-06-28 11:39:34'
--取前100条数据,limit都是在最后,可以和order by等组合查询--
select * from jz_know limit 0,20
select * from jz_know limit 20

--查询是否有标题重复的文章--
select title,count(title) as count from jz_know where e_aid=51 group by title having count>1 
select title,count(title) as count from jz_know group by title having count>1 


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值