public inbox for [email protected]  
help / color / mirror / Atom feed
From: e-letter <[email protected]>
To: [email protected]
Subject: insert into table with nest query
Date: Tue, 25 Apr 2023 16:43:39 +0100
Message-ID: <CAET1fe5dXJGcvFFV=RzOQ3q+d-vVXK4k0ARb8QbA47Vyuv43nA@mail.gmail.com> (raw)

Readers,

table1
column1,column2
value1,value2

table2
column2,column3
value2, value3

table3
column1,column2,column3
value1,value2,value3

When value3 is first entered into table2, what are the correct
commands for value2 (in table2) and value1 (in table1) to be selected
for insertion into table 3?

INSERT INTO table3 SELECT ... WHERE value3='...';

The conceptual difficulty is how to use nested query correctly, or is
there a better method? Thank you.





view thread (2+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected]
  Subject: Re: insert into table with nest query
  In-Reply-To: <CAET1fe5dXJGcvFFV=RzOQ3q+d-vVXK4k0ARb8QbA47Vyuv43nA@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox