DECODE

DECODE

DECODE is a single-row function in Oracle, which applies conditional logic to SQL queries. This function works very much like an IF-THEN-ELSE statement.

Syntax: DECODE (expression1, value1, return_value1, value2, return_value2, ... valueN, return_valueN, [default_return_value] )

How it works

If expression1 equals value1 then return_value1 is returned by DECODE function, and if expression1 equals value2 then return_value2 is returned and so on…..

The optional default_return_value is returned if expression1 does not match with any of (value1, value2, ..., valueN).

In short

IF expression1 = valueN THEN return_valueN ELSE default_return_value

Example: DECODE (day_id, '1', 'Monday', '2', 'Tuesday', .... '7', 'Sunday', 'Not Valid')


Wikimedia Foundation. 2010.

Игры ⚽ Нужна курсовая?

Look at other dictionaries:

  • Decode — «Decode» Сингл Paramore из альбома Сумерки (саундтрек) …   Википедия

  • Decode — Saltar a navegación, búsqueda «Decode» Sencillo de Paramore del álbum BSO de Twilight Publicación 10 de octubre 2008 …   Wikipedia Español

  • Decode — Single par Paramore extrait de l’album Brand new eyes (Edition internationale) Face A Decode Face B Decode (version acoustique) Sortie le 19 novembre 2008 Durée …   Wikipédia en Français

  • decode — v. t. to convert from a coded form into the original form; of communications. Inverse of encode. Syn: decrypt, decipher[WE1]. [PJC] …   The Collaborative International Dictionary of English

  • decode — index construe (comprehend), construe (translate), elucidate, find (discover), interpret, solve …   Law dictionary

  • decode — (v.) 1896, from DE (Cf. de ) + CODE (Cf. code). Related: Decoded; decoding …   Etymology dictionary

  • decode — [v] decipher break, clear up, crack, crack the code, decrypt, figure out, find the solution, interpret, make clear, read, solve, translate, unravel, unriddle, unscramble, untangle, work out; concepts 15,31,37 …   New thesaurus

  • decode — ► VERB 1) convert (a coded message) into intelligible language. 2) convert (audio or video signals), in particular from analogue to digital. DERIVATIVES decodable adjective decoder noun …   English terms dictionary

  • decode — [dē kōd′, dē′kōd′] vt. decoded, decoding 1. to translate (a coded message) into ordinary language 2. to convert (data) by removing or reversing previously applied electronic code …   English World dictionary

  • decode — [[t]di͟ːko͟ʊd[/t]] decodes, decoding, decoded 1) VERB If you decode a message that has been written or spoken in a code, you change it into ordinary language. [V n] All he had to do was decode it and pass it over... [V n] The secret documents… …   English dictionary

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”