Home:ALL Converter>Equivalent Postgres query for an Oracle query

Equivalent Postgres query for an Oracle query

Ask Time:2014-02-07T22:45:41         Author:Jenson

Json Formatter

Which Postgres query is equivalent to the following Oracle query?

select CID,
  max(cus.customer_id)  keep (dense_rank first order by decode(acct.CUS_Type,'X',4,'M',5,'F',6,'G',7,'I',5,6), start_date)  best_CUS
  from cusomer cus
    group by CID ;

Author:Jenson,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/21630601/equivalent-postgres-query-for-an-oracle-query
yy