使用查询结果作为表名 [英] Using the result of a query as a table name

查看:25
本文介绍了使用查询结果作为表名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我们有如下表A:

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

如何执行涉及 A.table 值作为表名的查询?

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

我的意思是这样的:

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

但在一个声明中.

推荐答案

SQLite 没有动态构造 SQL 语句的内置机制;这是不可能的.

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

(有 eval 扩展,但它不是默认发行版的一部分.)

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

这篇关于使用查询结果作为表名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆