Skip to content

Instantly share code, notes, and snippets.

@vivalalova
Created May 21, 2018 10:47
Show Gist options
  • Select an option

  • Save vivalalova/57994e2dee3b3c0293450071f10baedf to your computer and use it in GitHub Desktop.

Select an option

Save vivalalova/57994e2dee3b3c0293450071f10baedf to your computer and use it in GitHub Desktop.
query location
SELECT *
FROM ${DB1}.drivers_ping a
WHERE EXISTS ( SELECT * FROM ${DB2}.village b WHERE st_contains(b.area, POINT(Y(a.location), X(a.location))) AND b.town = "南港區" )
and a.month = 5
and a.day = 14
GROUP BY uid
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment