Decode equivalent in postgres

前端 未结 3 696
一整个雨季
一整个雨季 2021-02-13 02:36

There is no equivalent to the Oracle\'s DECODE()\'Function InPostgres`. Is there anyone who wrote decode as a Function?

3条回答
  •  庸人自扰
    2021-02-13 03:16

    If you are used to Oracle specific functions, you might want to install PostgreSQL extension orafce.

    Among other Oracle specific functions, orafce also implements DECODE - one that you are looking for.

    If you are running on Ubuntu, you will simply need to install package postgresql-9.1-orafce to make orafce available in your PostgreSQL server.

提交回复
热议问题