当前位置:网站首页>True MySQL interview question (XXII) -- condition screening and grouping screening after table connection
True MySQL interview question (XXII) -- condition screening and grouping screening after table connection
2022-06-23 05:47:00 【Socialphobia_ FOGO】
Select the day to browse the listings 10 Users who have registered for more than one year
A house source platform has two tables to record user information 、 And users to view the listing information .
User table ( The user no. 、 User registration time ).
Browse the table , The field has a log number , The user no. , House source No , Browse date .
problem : Select the day to browse the listings 10 Users who have registered for more than one year .、
give the result as follows :
# Analyze the current day's browsing listings 10 Users who have registered for more than one year
SELECT
Browse date ,
The user no. ,
COUNT( House source No ) AS Number of houses
FROM
Browse the table a
JOIN User table b USING ( The user no. )
WHERE DATE_SUB( Browse date , INTERVAL 1 YEAR) > Registration time
GROUP BY Browse date ,
The user no.
HAVING COUNT( House source No ) > 10
边栏推荐
- PAT 乙等 1019 C语言
- 移动电源快充QC3.0方案芯片IP5318快充方案
- C primer plus学习笔记 —— 2、常量与格式化IO(输入/输出)
- MySQL面试真题(二十一)——金融-贷款逾期
- Ip6809 three coil 15W wireless charging transmitter scheme IC British chip
- Jvm: when a method is overloaded, the specific method to call is determined by the static type of the incoming parameter rather than the actual type of the parameter
- 【斯坦福计网CS144项目】Lab2: TCPReceiver
- PAT 乙等 1026 程序运行时间
- MySQL面试真题(三十)——贝壳-房产订单分析
- visdom的使用
猜你喜欢

数字藏品——新的投资机遇

Heimdall database proxy scale out 20 times

Activity启动模式和生命周期实测结果

MySQL面试真题(二十八)——案例-通讯运营商指标分析

Software design and Development Notes 2: serial port debugging tool based on QT design

sprintf 格式代码使用不规范在不同平台下的表现

What is the reason for the black screen of the computer monitor when the computer is turned on? What should I do about the black screen of the computer monitor

MDM data cleaning function development description

jvm: 方法重载时,具体调用哪个方法,是由传入参数的静态类型来决定的,而不是由参数的实际类型来决定

A bit of knowledge - folding forging and Damascus steel
随机推荐
Raspberry pie assert preliminary exercise
jvm: 方法重载时,具体调用哪个方法,是由传入参数的静态类型来决定的,而不是由参数的实际类型来决定
数字藏品如何赋能经济实体?
Alibaba cloud object storage oss+picgo+typera implements the construction map
[graduation season u; advanced technology Er] farewell to the confused self in the past two years. Regroup, junior I'm coming
树莓派assert初步使用练习
ArcTime 制作中英文字幕视频
云原生数据库是未来
ssm项目搭建
How can digital collections empower economic entities?
PAT 乙等 1024 科学记数法 C语言
Opencv display image
Meteorological mapping software panoply tutorial (updated from time to time)
Ip6809 three coil 15W wireless charging transmitter scheme IC British chip
PAT 乙等 1022 D进制的A+B
PAT 乙等 1018 C语言
A bit of knowledge - folding forging and Damascus steel
【数据库备份】通过定时任务完成MySQL数据库的备份
Leetcode 797: all possible paths
Advanced Mathematics (Seventh Edition) Tongji University exercises 1-8 personal solutions