Fabrizio Mazzoni Asked: 2015-05-05 04:21:17 +0800 CST2015-05-05 04:21:17 +0800 CST 2015-05-05 04:21:17 +0800 CST Postgres 知道哪个列返回正结果 772 假设我们有这样的查询: select * from table where a=1 or b=2 or c=3 满足的条件是a=1和c=3 是否有可能在查询中(在输出中)知道哪些列a与cwhere 子句匹配? postgresql postgresql-9.4 1 个回答 Voted Best Answer Colin 't Hart 2015-05-05T04:35:06+08:002015-05-05T04:35:06+08:00 就像是: select t.*, a=1 as "a=1", b=2 as "b=2", c=3 as "c=3" from table t where a=1 or b=2 or c=3;
就像是: