我正在python中使用cx-oracle模块。我有两张这样的桌子:
第一张桌子:
| parameter | context |
+--------------+------------+
| a | column_1 |
| b | column_2 |
第二名:
|id| column_1 | column_2 |
+--+----------------+-------------+
| 1| bla1 | (NULL) |
| 2| bla2 | (NULL) |
| 3| (NULL) | (nla1) |
| 4| (NULL) | (nla2) |
输入为:
a, nla1
如果我想从第二个表返回id = 3
,那么如何创建查询呢?你知道吗
表结构已经是这样了。我不能改变它。你知道吗
用常规SQL编写这样的语句是不可能的:您需要使用动态的,这意味着PL/SQL。Find out more。你知道吗
简单的实现是这样的:
使用动态SQL在运行时设计查询,然后执行IMMEDIATE子句。你知道吗
相关问题 更多 >
编程相关推荐