•   DOC[U]MENT
    • Login
  •   Disclaimer
  •   Useful Source
  •   Project
    • Access2Csv [FreeWare]
    • Ip2Country [Service API]
    • Reformator [FreeWare]
      • GLO INPUT
      • GLO TEMPLATE
      • GLO OUTPUT
      • INPUT
      • EXPRESSION
      • TEMPLATE
      • OUTPUT
      • Reformator 0.12
  •   Download
  •   Paper
    • ORACLE
      • ORACLE - ORA-01017
      • ORACLE - ORA-12154
      • ORACLE - ORA-12696
      • ORACLE - ORA-12699
      • ORACLE - CASE WHEN
      • ORACLE - Deffered
      • ORACLE - DROP COLUMN
      • ORACLE - Privilege View
      • ORACLE - 365 DAYS
      • ORACLE - CREATE TABLE
      • ORACLE - Database Vault
      • ORACLE - INDEX
      • ORACLE - Questions
      • ORACLE - Raise Error
      • ORACLE - Temporary Table
      • ORACLE - Win7 Laptop
      • ORACLE - Switch User
    • C++
      • C++ Array as argument
      • C++ Constants and Volatiles
      • C++ Functions
      • C++ Reference vs Pointer
    • Solaris
      • Unix - Add/Mod/Rem Users
      • Unix - Crontab
      • Unix - Enumerate Groups
      • Unix - File Navigation Bases
      • Unix - File Permissions
      • Unix - Shell Autocomplete
    • How to..
      • ORACLE@AMD64
      • Open .BIN file
    • Drupal: EME
  •   Author
    • Curriculum Vitae
    • Contact

Imagination is more important than knowledge.

— Albert Einstein

ORACLE - CASE WHEN

Sun, 08/23/2009 - 15:54 |  Juraj Maslik

Simple example of translating DAY_NUMBER to DAY_NAME using CASE WHEN:

SELECT 
      CASE 
          WHEN DAY_NUMBER = 1 THEN 'MONDAY'
          WHEN DAY_NUMBER = 2 THEN 'TUESDAY'
          WHEN DAY_NUMBER = 3 THEN 'WEDNESDAY'
          WHEN DAY_NUMBER = 4 THEN 'THURSDAY'
          WHEN DAY_NUMBER = 5 THEN 'FRIDAY'
          WHEN DAY_NUMBER = 6 THEN 'SATURDAY'
          ELSE 'SUNDAY'
      END AS DAY_NAME
FROM
      TBL_DAY_NUMBER;
Juraj Maslik | Document - Extract and Share | Access2Csv | Reformator | Download
Oracle Articles | Oracle Certified Expert | Oracle Certified Associate | Unix Systems Administration | SEO
© 2010 [document.sk, soap.sk, hand.sk]
document.sk on facebookdocument.sk on ftwitter