有下列数据库中表tb_event,表中字段定义如下:
CREATE TABLE tb_event
(
id bigserial NOT NULL,
smtp_rcpt character varying(2048),
count_mlink integer,
time_date timestamp without time zone NOT NULL
)
数据库中的数据如下所示:
id | smtp_rcpt | count_mlink | time_date |
1 | test_user2@trendmicro.com.cn | 9 | 2017-07-09 21:15:08 |
2 | test_user1@trendmicro.com.cn | 3 | 2017-07-11 21:15:10 |
3 | test_user1@trendmicro.com.cn | 4 | 2017-07-11 21:15:20 |
4 | test_user3@trendmicro.com.cn | 2 | 2017-07-15 21:15:25 |
5 | test_user4@trendmicro.com.cn | 0 | 2017-07-15 21:15:25 |
6 | test_user2@trendmicro.com.cn | 1 | 2017-07-16 21:15:30 |
7 | test_user2@trendmicro.com.cn | 3 | 2017-07-17 07:33:31 |
8 | test_user4@trendmicro.com.cn | 3 | 2017-07-17 08:13:23 |
9 | test_user1@trendmicro.com.cn | 6 | 2017-07-17 08:13:33 |
10 | test_user2@trendmicro.com.cn | 0 | 2017-07-17 08:13:44 |
问题:执行下列SQL之后的结果是以下哪个?
SELECT smtp_rcpt, SUM(count_mlink) FROM tb_event
WHERE time_date > '2017-7-15 00:00:00'
GROUP BY smtp_rcpt
HAVING SUM(count_mlink) > (select avg(count_mlink) from tb_event)