----------------------------------------------------------------------------------------------------------
SELECT
sh_company.company_id,
sh_timezone.tz_name,
sh_timezone.tz_id,
sh_timezone.tz_unit_hm,
CONVERT_TZ(sh_company.paywall_end_date,
sh_timezone.tz_name,
sh_timezone.tz_name) AS time,
CONVERT_TZ(sh_company.paywall_end_date,
'utc',
sh_timezone.tz_name) AS time1,
sh_company.paywall_end_date
FROM
sh_company
LEFT JOIN
sh_location ON sh_location.company_id = sh_company.company_id
LEFT JOIN
sh_timezone ON sh_timezone.tz_id = sh_location.tz_id
WHERE
paywall_status = 'INACTIVE'
AND CONVERT_TZ(paywall_end_date,
sh_timezone.tz_name,
sh_timezone.tz_name) <= CONVERT_TZ('2020-08-14 23:59:59',
'utc',
sh_timezone.tz_name)
AND paywall_end_date != '0000-00-00 00:00:00'
AND name != '1Huddle'
AND sh_location.head_location = 1;
-------------------------------------------------------------------------------------------------------------
No comments:
Post a Comment