sql querying selected columns.... non normalized table
Posted on 2002-04-16
My table structure was designed as follows :
Field Name---> Empno, Day1, Day2, Day3 ... Day30
Type ---> (Int), Int, Int, Int, ... Int
assumption : Day1 = 1st day of the month
Day2 = 2nd day of the month ...etc.
The query :
based on a given Date .... select only the required columns (Day? ... Day?)
for example :
Input Date = 10th Jan. to 12th Jan.
the result set should be :
Empno, Day10, Day11, Day12.
can this be done using SQL ?
Note : If I normalized the table, it would solve all the problems .. but, I can't change the existing table structure, unfortunately.