Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

Postgresql select join by date - Join rows where a timestamp value is equal to midnight of the date

SELECT t1.*
FROM t1 
JOIN t2 ON (
    t1.t2_id = t2.id AND
    t1.date_field::TIMESTAMP = t2.datetime_field AT TIME ZONE 'Europe/London'
)
Source by codeinthehole.com #
 
PREVIOUS NEXT
Tagged: #Postgresql #select #join #date #Join #rows #timestamp #equal #midnight #date
ADD COMMENT
Topic
Name
3+3 =