Skip to content
Advertisement

Tag: postgresql

Getting error while tryng to add geometry (polygon z) to table

I’m trying to insert a row to postgres (postgis) table and getting error. My table (geo_table) properties: I’m trying to add data: I’m getting the following error: syntax error at or near “Z” …(name, geometry, in_use) VALUES (‘tb2’, POLYGON Z (( what is the error ? and how can I add data ? Answer Try to include between single quotes

How order by case and order too?

i have a query for my next table This could be the sql query : but now i need order by case: example: when ‘Scholar’ then 1 desc its possible do that? my goal is order by id, and by case type example: the result will be: Answer Your question suggests that want a new direction within each group: However,

Obtain latest record for a given second Postgres

I have data with millisecond precision timestamp. I want to only filter for the most recent timestamp within a given second. Ie. records (2020-07-13 5:05.38.009, event1), (2020-07-13 5:05.38.012, event2) should only retrieve the latter. I’ve tried the following: But then I’m asked to group by event as well and I see all the data (as if no group by was

Advertisement