date在where之后,先连表,再筛选,数据此时很多b.date为NULL的数据就被过滤掉了,因此会导致并不是预期的左表的大小
selectcount(*)fromdm_data_gr.item_spu as aLEFT JOIN dm_data_gr.item_spu_top_sales as b on a.source_spu_id = b.source_spu_idwherea.date = ${date}and b.date = ${date}
selectcount(*)fromdm_data_gr.item_spu as aLEFT JOIN dm_data_gr.item_spu_top_sales as b on a.source_spu_id = b.source_spu_id and b.date=${date}wherea.date = ${date}
selectcount(*)from(select*fromdm_data_gr.item_spuwheredate = ${date}) as aleft join (select*fromdm_data_gr.item_spu_top_saleswheredate = ${date}) as b ON a.source_spu_id = b.source_spu_id
