Skip to content
Advertisement

Tag: postgresql

Accessing array elements in query postgres

I’m currently building a query to retrieve some data from my db, I need to access the documents stored in an array, this is how the table crm_company looks: I have another table for users by document crm_user which looks like this: What I want as a final result is: I just have tried somehing like the following: But I’m

SQL – Merge two rows with similar values

I have the following table called areas in a PostgreSQL server: So basically it’s nearly duplicate entries that have the same name and code, but different id, shape and created timestamp. What I want is to merge those duplicate rows, but overwrite the “shape” and “created” fields with the values of the newest entry. So eventually the above table would

Advertisement