This is a simple SQL Query used to show how the pivot option is used. Here in this example the columns JAN, FEB and MAR would be having single quotes and the other columns wont be having single quotes.

select *
from
(
select
period_set_name,
period_name,
–period_num,
entered_period_name
from gl_periods
where 1=1
)
pivot (count(period_name)
for
entered_period_name
IN ( ‘JAN’,
‘FEB’ ,
‘MAR’ ,
‘APR’ APR,
‘MAY’ MAY,
‘JUN’ JUN,
‘JUL’ JUL,
‘AUG’ AUG,
‘SEP’ SEP,
‘OCT’ OCT,
‘NOV’ NOV,
‘DEC’ DEC
)
)
;

Recent Posts

Start typing and press Enter to search