喜欢
select ho from (select sourceaddress,count(sourceaddress) as
src,hour(eventtime) as ho
from default.fullandfinal
where sourceaddress='0.0.0.0' and eventtime between '2019-05-11 00:00:00' and
'2019-05-11 19:59:59'
group by sourceaddress,hour(eventtime) order by sourceaddress,ho) t where
src=28350;
此查询的输出为11,我想在我的 nxt 查询中使用此输出,即
select sourceaddress,destinationaddress,destinationport,name,count(*) as count
from fullandfinal
where eventtime like "11%" and sourceaddress='0.0.0.0'
group by sourceaddress,destinationaddress,destinationport,name
order by count desc limit 5;
我想为此编写单个查询,这可能吗?