学习网站:

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

1.

【数据库】SQL语句解析

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); 

 

相关文章:

  • 2021-06-24
  • 2021-09-05
  • 2022-12-23
  • 2021-07-23
  • 2022-12-23
  • 2021-12-04
  • 2021-12-04
  • 2021-12-04
猜你喜欢
  • 2021-12-04
  • 2021-12-04
  • 2021-11-10
  • 2022-12-23
  • 2022-12-23
  • 2021-12-04
相关资源
相似解决方案