请帮我如何解决必须出现在GROUP BY子句或聚合函数中使用
我newbi在Postgres数据库
select
case
when daftar ='sd' then kouta
end as a,
case
when daftar = 'smp' then kouta
end as b,
case
when daftar = 'sma' then kouta
end as c
from
ajaran
GROUP BY
tahun
和结果误差
[Err] ERROR: column "ajaran.daftar" must appear in the GROUP BY clause or be used in an aggregate function LINE 1: select case when daftar='sd' then kouta end as a,case when ...
我想在MySQL中查询相同的查询,并且没有错误和成功分组 如何在pgsql中使用group by?
我想按tahun
MySQL是不正确的,让无差错运行查询,但MySQL是比PostgreSQL的那么严格(和大多数其他数据库系统,真的)。 – Dai
你期望输出什么数据?你知道'GROUP BY'是什么意思吗?在这种情况下,“tahun”是什么意思?它与“kouta”有什么关系? – Dai