> > INSERT INTO t (a, b, c, d) VALUES ('aa', 'bb', (SELECT c, d FROM t
> > WHERE <cond>));
> > with <cond> guaranteed to select exactly one row.
>
>I don't know of any DBMS where this would be valid.
It seems so.
>INSERT INTO t(a, b, c, d)
>SELECT 'aa', 'bb', c, d FROM t WHERE <cond>;
My mistake: I had more than a single select but deleted them in my
example to keep it short (but it then became trivial).
What suprises me is that a select of 1 field yields a field (not a
1-tuple containing 1 field) but then a select of n > 1 fields yields a
n-tuple, not a sequence of n fields.
In Mathematica parlance:
SameQ[{a,b,c,d}, {a,b,{c},{d}}] --> True, no Flatten required
SameQ[{a,b,c,d}, {a,b,{c,d}}] --> False, a Flatten would be required
Put in set theory, an element is equal to its singleton, but a set of
n>1 elements remains a set and not a collection. That's fairly weird.
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users