Skip to content

Tag: sql

Flatten a subarray in postgresql

Input: postgres=> select sets from matches limit 2; sets ———————- {{6,4},{6,2}} {{6,3},{5,7},{10,4}} (2 rows) Expected (Sum of the value in each array) postgres=…

Limit date for each day to 2:30 PM

SQL Oracle Query: I have datetime values in 30 minute intervals. I want to stop each day at 2:30 PM. I am limiting my hours with this: TO_CHAR(ALL_DATES.DATEDATE,’HH24′) NOT IN (01,02,03,04,05,06,07,…