時(shí)間:2024-02-05 12:47作者:下載吧人氣:25
最近,一個(gè)統(tǒng)計(jì)程序從Oracle移植到PostgreSQL(版本9.4)時(shí),接連報(bào)告錯(cuò)誤:
錯(cuò)誤信息1: postgresql group by position 0 is not in select list.
錯(cuò)誤信息2: non-integer constant in GROUP BY.
產(chǎn)生錯(cuò)誤的sql類(lèi)似于:
insert into sum_tab (IntField1, IntField2, StrField1, StrField2, cnt)
select IntField, 0, StrField, ‘null’, count(*) from detail_tab
where …
group by IntField, 0, StrField, ‘null’;
網(wǎng)友評(píng)論