On Wed, 22 Aug 2007, Terry Carroll wrote: > If you want to pull them out of the database as a single table.... > I was wondering that myself the other day. I was planning on looking > into whether you could just do a FULL OUTER JOIN (which is essentially a > union operation) on both tables. I haven't checked that out, yet; you > might want to look into it.
Actually, I'm making this much too hard (especially as I think SQLite, the only SQL database I have access to, apparently does not directly support FULL OUTER JOIN). But I just discovered the UNION keyword on the SELECT statement: sqlite> create table a1 (v1 int primary key, v2 text); sqlite> create table a2 (v1 int primary key, v2 text); sqlite> insert into a1 values(1, 'a'); sqlite> insert into a1 values(2, 'b'); sqlite> insert into a1 values(3, 'c'); sqlite> insert into a1 values(4, 'd'); sqlite> insert into a1 values(5, 'e'); sqlite> insert into a2 values(1, 'a'); sqlite> insert into a2 values(5, 'e'); sqlite> insert into a2 values(9, 'i'); sqlite> insert into a2 values(15, 'o'); sqlite> insert into a2 values(21, 'u'); sqlite> select * from a1; 1|a 2|b 3|c 4|d 5|e sqlite> select * from a2; 1|a 5|e 9|i 15|o 21|u sqlite> select * from a1 union select * from a2; 1|a 2|b 3|c 4|d 5|e 9|i 15|o 21|u Would that do what the OP wanted? You'd have to make the union select a Python call, of course. _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor