chai
chai copied to clipboard
SQL: Multi-table SELECT
Multi-table SELECT
is query like
SELECT * FROM foo, bar;
Example
If foo
table is:
a | b |
---|---|
1 | 2 |
2 | 1 |
and bar
is
c | d |
---|---|
3 | 4 |
4 | 3 |
Query result:
a | b | c | d |
---|---|---|---|
1 | 2 | 3 | 4 |
1 | 2 | 4 | 3 |
2 | 1 | 3 | 4 |
2 | 1 | 4 | 3 |
Hi,
can support be added for this type of multi table select(sqlite):
select (select 2), 1, 3;
it is not efficient as multi table joins, but enable splitting information to multiple tables to deal with data duplication:
select f1, f2, key_in_table2, ( select f1t2 from table2 where table1.key_in_table2 == table2.id) from table1
Regards