https://blog.csdn.net/qq_39019865/article/details/80769042
《INNER JOIN连接两个表、三个表、五个表的SQL语句》
使用多表链接虽然可行,但是运行时间特别长,仅查询一天的数据就可能用上12000+毫秒的时间
使用如下的别名表、临时表,并且注意where条件的先后顺序,可以将相同日期范围的查询时间缩短到4000毫秒
Reference: https://blog.csdn.net/zark721/article/details/63680532
SELECT c.accessdatetime, c.user_cd, c.url, d.category_code
FROM (select a.accessdatetime, a.user_cd, a.url, a.series_code
from raw_behavior.cn_trn_visit a
INNER JOIN master.view_cust_info b
ON a.user_cd=b.user_code
where a.accessdatetime between '2019-01-01' and '2019-01-02' and a.user_cd is not null
and a.series_code is not null and a.url like '%https://www.misumi.com.cn/vona2/detail/%'
and b.job_detail='设计、技术人员')
as c
INNER JOIN raw_master.mdm_m_ginner_inner11_chn d
ON c.series_code=d.series_code;
所以说,并不是写通顺,没有语法错误就可以了。进程会不会死掉、查询的效率——都是我们需要不断学习的问题。