【发布时间】:2014-05-27 09:11:57
【问题描述】:
我需要选择两个字段但条件不同,我试过这个:
SELECT
(select my_field from my_table where another_field=1) as column_one,
(select my_field from my_table where another_field=2) as column_two;
但我收到了这个错误:
Subquery returns more than 1 row
有没有办法让它工作?
【问题讨论】:
-
“工作”会是什么样子?
-
如前所述,将它们选择为 2 列没有多大意义。它们之间没有定义关系。