关闭

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

263人阅读 评论(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 


0
0

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:19421次
    • 积分:715
    • 等级:
    • 排名:千里之外
    • 原创:49篇
    • 转载:18篇
    • 译文:0篇
    • 评论:4条
    文章分类
    最新评论