Using the result of a query as a table name

2019-03-06 02:47发布

If we have table A as follows:

+-------+
+ Table +
+-------+

How would one perform a query involving values of A.table as the table name?

What I mean is something along the lines of this:

SELECT "Table" as "tbl" FROM "A";
SELECT * FROM "tbl";

but in one statement.

标签: sql sqlite3
1条回答
Explosion°爆炸
2楼-- · 2019-03-06 03:02

SQLite has no built-in mechanism to construct SQL statements dynamically; this is not possible.

(There is the eval extension, but it is not part of the default distribution.)

查看更多
登录 后发表回答