小编pak*_*oon的帖子

如何使用表列中的值作为 SELECT 查询中的字段名称?

设想:

Table1 的字段名称命名为 testtable

ID、名称、大小、宽度、高度

Table2 的字段名称命名为 errortable

id,desc,field1,field2,operator

errortable 的值

+----+-------------------------------------+--------+--------+----------+
| id |                desc                 | field1 | field2 | operator |
+----+-------------------------------------+--------+--------+----------+
|  1 | size should not greater than width  | size   | width  | >        |
|  2 | size should not greater than height | size   | height | >        |
|  3 | with should be equal to height      | width  | height | <>       |
+----+-------------------------------------+--------+--------+----------+
Run Code Online (Sandbox Code Playgroud)

现在我想检查testtable

  1. 计算大小 > 宽度的所有记录。
  2. 计算大小 …

mysql postgresql dynamic-sql plpgsql

2
推荐指数
1
解决办法
8312
查看次数

标签 统计

dynamic-sql ×1

mysql ×1

plpgsql ×1

postgresql ×1