New answers tagged


You can assign any numbers with a derived table. generate_series() is instrumental for a simple solution. With a table like this: CREATE TABLE things_to_do AS SELECT * FROM generate_series (1,6) AS thing_id; A simple solution for the given example SELECT * FROM things_to_do JOIN ( -- derived table with prepared timestamps SELECT row_number() OVER ...


Way 1 : I would suggest to have case embedded in your select. Way 2 : Have a function which does all the maths and call that.


On 18th of November, 1883 at 12:00 (new time), standard time was adopted by the American railroads. This means that before that time, Los Angeles used actual local time, based on mean solar time. After that, it was moved to its local time zone, which, being an integral offset of hours from the Greenwich Mean Time, was slightly different from the previous ...


posted_at should certainly be data type timestamptz, not varchar. (And id should be int or bigint.) Assuming timestamptz for posted_at and leaving further performance optimization aside, you could make it work range types and the range overlap operator &&: SELECT (a.status, b.status) FROM FB_status a JOIN FB_status b ON ST_Dwithin (a.geom, ...

Top 50 recent answers are included