Hi,
I am trying to get this SQL.
I have a table with the following fields
ID, Date, day1, day2 Day3, day4, day5
The values of the fields day1, day2, day3, day4, day5 can be the following: "c", "e", "k", "o"
If i have two records with values
Rec 1 Rec 2
ID 1 2
Date 11/11/2002 11/11/2002
Day1 c k
Day2 e o
Day3 c o
Day4 k o
Day5 o o
I want a sql wiich will give the records as
ID, date, TotalC, TotalE, TotalK, TotalO
REC1 = 1,11/11/2002,2,1,1,1
Rec2 = 2,11/11/2002,0,0,1,4
Any ideas how can i design this SQL? or are there any other alternatives.
I am trying to get this SQL.
I have a table with the following fields
ID, Date, day1, day2 Day3, day4, day5
The values of the fields day1, day2, day3, day4, day5 can be the following: "c", "e", "k", "o"
If i have two records with values
Rec 1 Rec 2
ID 1 2
Date 11/11/2002 11/11/2002
Day1 c k
Day2 e o
Day3 c o
Day4 k o
Day5 o o
I want a sql wiich will give the records as
ID, date, TotalC, TotalE, TotalK, TotalO
REC1 = 1,11/11/2002,2,1,1,1
Rec2 = 2,11/11/2002,0,0,1,4
Any ideas how can i design this SQL? or are there any other alternatives.