I am trying to print the top 5 sports according to the duration.
I ran the below query:
with t1
AS
(
select cast(duration as int),race,lap,sport
from db.table1
where exchange_code in ("tennis", "golf", "football")
and table1_date = 20201010
and duration is not null
and race is not null
and lap is not null
and sport is not null
)
select sum(duration_int) ,race,lap,sport
from t1
group by race,lap,sport
order by sum(duration_int) desc
limit 5;
And the results are these:
sum(duration_int) race lap sport
[null] first second golf
408439363026
65886284 fourth third football
33687102 fifth first american-football
22642805 tenth fifth english-football
As you can see I have null values after the condition IS NOT NULL
.
question from:
https://stackoverflow.com/questions/65918288/impala-return-null-values-after-is-not-equal-condition 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…