vgrabovets
12/13/2016 - 8:26 AM

user service

user service

SELECT
  user_id
, status
, s2.title
, s.service_id
, s.parent_id
, FROM_UNIXTIME(date_start)  start_date
, FROM_UNIXTIME(date_finish) finish_date
, us.geo
FROM
  billing.user_service us
    LEFT JOIN megogo2.service s ON s.service_id = us.service_id
    LEFT JOIN megogo2.service s2 ON s2.service_id = s.parent_id
WHERE s.type NOT IN (1, 5)
AND user_id = 141328421;