Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New function of sql -Decode [CORE2593] #3003

Closed
firebird-automations opened this issue Aug 14, 2009 · 5 comments
Closed

New function of sql -Decode [CORE2593] #3003

firebird-automations opened this issue Aug 14, 2009 · 5 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: Ivan (patuljak)

Decode is nice function in oracle database which replace case function.

this mean if I can sum but for different condition , this function je very powerful for this.

@firebird-automations
Copy link
Collaborator Author

Commented by: @dyemanov

And what's wrong with the CASE function? Unlike DECODE, it's standard, this is why anything else is unlikely to be considered.

@firebird-automations
Copy link
Collaborator Author

Commented by: @hvlad

There is standard CASE expression already implemented.
I personally see no reason to introduce ugly syntax sugar.
But, it is already implemented in FB 2.1

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

Component: Engine [ 10000 ]

Version: 3.0.0 [ 10048 ] =>

Component: ISQL [ 10003 ] =>

@firebird-automations
Copy link
Collaborator Author

Commented by: @pmakowski

see release notes :
DECODE is a shortcut for a CASE ... WHEN ... ELSE expression.
Format:

DECODE( <expression>, <search>, <result>
[ , <search>, <result> ... ] [, <default> ]

Example

select decode(state, 0, 'deleted', 1, 'active', 'unknown') from things;

@firebird-automations
Copy link
Collaborator Author

Modified by: @pmakowski

status: Open [ 1 ] => Closed [ 6 ]

resolution: Fixed [ 1 ]

Fix Version: 2.1.0 [ 10041 ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant