vipkid:20届数据分析笔试
第一题:
select t.col_1,t.col_2,t.col_3,col_11,t.col_4 from (select t2.col_1,t2.col_2,t1.col_3,t1.col_1 as col_11,t1.col_4 from ( select * from Table_B )t1 left join( select * from Table_A )t2 on t1.col_1=t2.col_1 union all select * ,'NULL','NULL','NULL' from Table_A where col_1='c' )t order by t.col_1运行结果:如何将null放到最后啊?
第二题:mysql|oracel
select t.month,t.sum_amount,sum(t.sum_amount)over( order by t.month) as 'add_amount' from (select left(date(paid_time),7) as 'month',sum(amount) as 'sum_amount' from order_record group by left(date(paid_time),7) )t order by t.month如何用SQLite改写啊???