SQL 基礎
Last updated
Was this helpful?
Last updated
Was this helpful?
http://www.postgresqltutorial.com/
https://www.w3schools.com/sql/sql_datatypes.asp
或是建表時設定
可以使用 with as,後面一定要接著 select 語句
也可參考 postGIS https://postgis.net/
https://stackoverflow.com/a/25140461
搜尋兩人距離範例:
完整範例:
DISTINCT ON 只有 postgres 有, MySQL 要使用 group by,另外 postgres 的 group by 不能單獨選擇特定對象,必須要包含在 select 裡面
https://stackoverflow.com/a/9796104/4622645
如果 A 有多筆資料,想要 DISTINCT A 中最新的,之後把選出來的 A, B, C 再依照時間排序