Oracle SQL display a different column depending on the date -


i have table has 33 columns

employee     month    day1    day2 ...... etc. etc. 

the day column represents day of month.

is possible display employee column , day of month depending on today's date?

i.e.

12th may

employee day12

no idea start if it's possible. great

you record (here: month) clause. column (here: day) decode or case.

select    employee,    decode( extract(day sysdate), 1, day1, 2, day2, 3, day3, ... ) day mytable t t.month = extract(month sysdate) group employee order employee; 

Comments

Popular posts from this blog

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -