SELECT t4.uid AS uid1,t4.d1 ,t5.uid AS uid2,LEFT(t5.IN_TIME,10) d2 FROM ( -- 求新用户第一个日期出现的用户 SELECT t2.* FROM ( SELECT t1.uid ,LEFT(t1.IN_TIME,10) AS d1 ,ROW_NUMBER() over(PARTITION BY t1.uid ORDER BY t1.in_time) cnt FROM tb_user_log t1 ) t2 WHERE t2.cnt = 1 ) t4 LEFT JOIN tb_user_log t5 ON t4.uid...