Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Mon, 07 Apr 2003 @ 09:58:25 GMT


     
  <Prev Next>   <<First <Prev
Next>
Last>>
 


Subj:   Re: How to concatenate case expressions
 
From:   Barham, William

Enclose the case statement in parentheses as below.

insert into dw_temps select
calendar_date,day_of_month,day_of_year,
(case when day_of_week='1' then 'Dimanche '||trim(day_of_month)
when day_of_week='2' then 'Lundi '||trim(day_of_month)
when day_of_week='3' then 'Mardi '||trim(day_of_month)
when day_of_week='4' then 'Mercredi '||trim(day_of_month)
when day_of_week='5' then 'Jeudi '||trim(day_of_month)
when day_of_week='6' then 'Vendredi '||trim(day_of_month)
when day_of_week='7' then 'Samedi '||trim(day_of_month)
end )

||

(case when month_of_year='1' then ' Janvier '
when month_of_year='2' then ' Février'
when month_of_year='3' then ' Mars'
when month_of_year='4' then ' Avril'
when month_of_year='5' then ' Mai '
when month_of_year='6' then ' Juin'
when month_of_year='7' then ' Juillet'
when month_of_year='8' then ' Ao=FBt'
when month_of_year='9' then ' Septembre'
when month_of_year='10' then ' Octobre'
when month_of_year='11' then ' Novembre'
when month_of_year='12' then ' Décembre'
end)

from sys_calendar.calendar

where extract(year from calendar_date) = '2003' order by calendar_date


     
  <Prev Next>   <<First <Prev
Next>
Last>>
 
 
 
 
 
 
 
 
 
  
  Top Home Privacy Feedback  
 
 
Copyright for the TeradataForum (TDATA-L), Manta BlueSky    
Copyright 2016 - All Rights Reserved    
Last Modified: 27 Dec 2016