【发布时间】:2014-01-13 04:50:39
【问题描述】:
我想有条件地从 MySQL 存储过程中的 SELECT 子句中隐藏列。查询是
SELECT year,gwp_amount,claim_amount,cancellation_amount from tmptable;
我想有条件地显示gwp_amount,claim_amount,cancellation_amount 列,
有时我想显示gwp_amount and claim_amount 列,
有时gwp_amount and cancellation_amount 列,
有时one of the column 和
有时all three columns。
我在存储过程中传递了三个指标,例如 gwp_ind、calim_ind、cancellation_ind。
我想根据这些参数显示这些列。
【问题讨论】:
-
您希望输出是什么样的?根据定义,关系中的所有行都具有相同的列集。
标签: mysql