select t.order_date, t.user_id, t.order_nums, uservip_tb.vip from ( select user_id, date(order_time) as order_date, count(distinct order_id) as order_nums from order_tb group by user_id, date(order_time) having count(distinct order_id) > 1 ) t left join uservip_tb using (user_id) order by t.order_nums desc