私が書いたこのSQLステートメントがあります。私が書こうとしているこのSQL文はpostgresにあります。オラクルに同じSQL文があり、正常に動作します。構文を読みましたが、問題ないようです。Oracle SQL ステートメントは次のようになります。
select to_char(calldate,'Day') as Day,
trunc(calldate) as transdate,
decode(zoneorange,'-1, 'Onnet','0','Orange Uganda','1','UTL','2','MTN',3,'Airtel','4','Warid','5','MTN Fixed','Undefined') as destination
私が書いたpostgres sqlステートメントは次のようになります。
select to_char(calldate,'Day') as Day,
date_trunc('day',calldate) as transdate,
(case when zoneorange = '-1'
then 'Onnet'::text = '0'
then 'Orange Uganda' = '1'
then 'UTL' = '2'
then 'MTN' =3
then 'Airtel' = '4'
then 'Warid' = '5',
then 'MTN Fixed'
else 'Undefined' end) as destination
私のケースステートメントの構文エラーについて不平を言います。私には問題ないように見えるので、何が悪いのかわかりません。postgresql クエリで何が間違っている可能性がありますか。