Skip to content

Instantly share code, notes, and snippets.

@maartenl
Created February 7, 2013 06:14
Show Gist options
  • Save maartenl/4728923 to your computer and use it in GitHub Desktop.
Save maartenl/4728923 to your computer and use it in GitHub Desktop.
Examples of DECODE to CASE.
-- provides percentage taxation
DECODE (tax.taxtype, 'VAT', tax.vat, tax.general) TAX,
-- changed to
CASE tax.taxtype
WHEN 'VAT' THEN tax.vat
ELSE tax.general
END TAX,
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment