select avg(if(datediff(date2,date1)=1, 1, 0)) as avg_ret from ( select distinct device_id, date as date1, lead (date, 1, null) over ( partition by device_id order by date ) as date2 from( select distinct device_id, date from question_practice_detail )as unique_id_qpd )as id_date_qpd 一、 if(判断,真,假) 函数...