>>>>> Ivan Shmakov writes:
>>>>> Simon Slavin writes:
>>>>> On 2 Nov 2012, at 8:58am, Ivan Shmakov wrote:
>>> INSERT OR IGNORE INTO "foo" ("foo")
>>> VALUES (?1);
>>> INSERT INTO "bar" ("foo")
>>> VALUES ((SELECT f."rowid" FROM "foo" f WHERE f."foo" = ?1));
[…]
> The end result for the command sequence I'm looking for is simple:
> • "foo" has a (foo → ?1) record — it doesn't matter if it was
> INSERT'ed just now, or was added at some point before;
> • "bar" has a (foo → id) record, where ‘id’ is the ROWID of the
> aforementioned "foo" record.
Correction: “… has a /new/ (foo → id) record…”
> AIUI, the command sequence above does just that.
[…]
--
FSF associate member #7257
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users