INSERT / UPDATE into 2 inner joined table simultaneously

From: Lou <lou(at)dayspringpublisher(dot)com>
To: pgsql-sql(at)lists(dot)postgresql(dot)org
Subject: INSERT / UPDATE into 2 inner joined table simultaneously
Date: 2019-03-06 19:59:22
Message-ID: 38a1b75c-2a29-5833-cbd6-6b76dca019da@dayspringpublisher.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hi everyone,

This is my first post here.

I have two tables named c and p. When using SELECT, they are linked
using an INNER JOIN like in this example: "SELECT * FROM c INNER JOIN p
ON c.id = p.c_id WHERE name = 'Jones';"

How can I INSERT new rows into both tables simultaneously with
automatically created id numbers, and how can I UPDATE both tables
simultaneously?

Lou

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Christopher Swingley 2019-03-06 20:11:23 Re: INSERT / UPDATE into 2 inner joined table simultaneously
Previous Message Andrew Gierth 2019-03-01 13:25:53 Re: Why does GROUP BY reduce number of rows?