Skip to content

Tag: postgresql

PostgreSQL equivalent of Pandas outer merge

I am trying to do in Postgres the equivalent of Pandas outer merge, in order to outer merge two tables. Table df_1 contains these data: Table df_2 contains these data: So Table df_1 has one extra column (random_id) than df_2. Also, job_id 1711418 and worker_id 45430 exist in both df_1 and df_2. If I use the &…

PostgreSQL query update returns UPDATE 0

I am having trouble with a PostgreSQL query where my update condition contains more prerequisites. I attached 2 images to describe my problem. I want to update the highlighted row But the response is: Answer Your problem might be somewhere else (see this db<>fiddle) A few thoughts on your data: Reduce t…

Transform JSON rows into PostgreSQL Table

I have a table in my database that returns me some columns. One of them is a list of JSONs that are, in fact, other tables, but in JSON format. The image belows show an example. I want to transform each row of that column “data” into separate tables, because I need specific information inside each…