示例:
date_entry time_start time_finished idle_code
8/8/2013 8:00 9:00 0
8/8/2013 9:01 10:00 1
8/8/2013 11:01 12:00 2
8/8/2013 12:01 13:00 3
8/8/2013 13:01 14:00 4
8/8/2013 14:01 15:00 5
8/8/2013 16:01 17:00 6
8/8/2013 17:01 18:00 7
如何组合/分组idle_code'0'和6 然后另一组idle_code'1','2','3','4','5','7'
我只需要群组A ='0','6'和群组B ='1','2','3','4','5','7'
答案 0 :(得分:0)
您可以尝试按case
进行分组,如下所示:
select ...
from ...
where ...
group by case
when (idle_code in ('0', '6')) then
'A'
else
'B'
end
P.S。我没有PowerBuilder,所以我在Oracle上检查了它