2022年3月10日 星期四

timestamp 查詢某月份資料

這裡timestamp和timestamp with time zone都可以處理

Select * From patient_examine_order where to_char(sampling_date, 'YYYYMM') like '202102%'

可以使用to_char再搭配like組字做使用

超難的阿~~

https://www.postgresql.org/docs/9.6/functions-formatting.html

沒有留言:

張貼留言

Aider及gemini合併使用心得

嘗試Aider SDD套用gemini 我發現ai全自動產code有一個現象, 就是我心中有一個完美的想法, ai可能基於他的背景資訊未必想得到, 也或著就是ai已經被各種知識訓練過, 他可能選擇了一種, 但是並沒有查覺到其中有什麼問題, 很多時候的solution就是想得太簡單...