如
select distinct card_no,sum(decode(month,'01',sell)) as one from months where card_no='01010102' group by month,card_no
上例中报错提示
ORA-00937: 非单组分组函数
在card_no处。请问如何解决,
我想求出card_no,和sum值。
select distinct card_no,sum(decode(month,'01',sell)) as one from months where card_no='01010102' group by month,card_no
上例中报错提示
ORA-00937: 非单组分组函数
在card_no处。请问如何解决,
我想求出card_no,和sum值。
select distinct card_no,sum(decode(month,'01',sell)) as one from months group by month,card_no having card_no='01010102'
即可
from months
where card_no='01010102'
and month = '01';