我对 Oracle 很陌生,我正在为我的项目开发一个查询。对我来说,似乎一切正常,但是在执行查询时,oracle 给出了错误“ORA-00905:缺少关键字”。
她是我的疑问::
SELECT DISTINCT ba.uuid AS uuid
, COUNT(*) over() AS rowcount
FROM basicaddress ba
WHERE ba.postalcode='143456'
OR ba.lastname LIKE '%143456%'
OR ba.city LIKE '%143456%'
GROUP BY CASE WHEN ba.postalcode='143456' THEN ba.postalcode, ba.uuid END
, CASE WHEN ba.lastname LIKE '%143456%' THEN ba.lastname, ba.uuid END
, CASE WHEN ba.city LIKE '%143456%' THEN ba.city, ba.uuid
ELSE ba.postalcode,ba.uuid END
ORDER BY CASE WHEN ba.postalcode='143456' THEN ba.postalcode END DESC
, CASE WHEN ba.lastname LIKE '%143456%' THEN ba.lastname END ASC
, CASE WHEN ba.city LIKE '%143456%' THEN ba.city ASC
ELSE ba.postalcode END DESC
我缺少什么关键字?任何帮助将不胜感激。