首页 > 数据库技术 > 详细

【数据库】SQL语句解析

时间:2019-02-24 21:48:30      阅读:186      评论:0      收藏:0      [点我收藏+]

学习网站:

http://www.runoob.com/sql/sql-having.html

1.

技术分享图片

1.现在我们想要查找总访问量大于 200 的网站。

回取出多条重复的网址的SQL语句:

1 select 
2  a.url 
3 from websites a 
4 inner join access_log b
5 on a.id=b.site_id
6 where b.count>200 
只能取到不重复的网址的SQL语句:
1 select 
2  a.url 
3 from websites a 
4  where a.id in (select site_id from access_log b where b.count>200); 

 

 

【数据库】SQL语句解析

原文:https://www.cnblogs.com/zhuzhubaoya/p/10427955.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!