subquery vs derived tables
sql cast
Syntax The syntax for the CAST function is: CAST ( value AS type )
cast(click_num_str as int) as click_num
派生表需要别名,这是经常忘记的事情,需要记录和弄懂
Keep in mind that a subquery and derived tables are not the same; a derived table vs subquery comparison will show you that there are many differences between the two.
subquery
select * from tmp where a in (select a from xxx)
derived tables
select count(1) from (select * from a) as t