gjsaturday
Technical User
My table looks like
tb1
id m t w th f s
1 1 0 0 1 0 0
2 0 1 0 0 1 0
3 1 0 1 0 1 0
I'm trying to get a result set to look like
id Day
1 Monday
1 Thursday
2 Tuesday
2 Friday
3 Monday
3 Wednesday
3 Friday
I'm using the following:
select id,
case WHEN m <> 0 THEN 'Monday'
when t <> 0 then 'Tuesday'
when w <> 0 then 'Wednesday'
when th <> 0 then 'Thursday'
when f <> 0 then 'Friday'
when s <> 0 then 'Saturday'
ELSE 'None' end
from tb1
my result set looks like
id Day
1 Monday
2 Tuesday
3 Monday
How can I get the other days?
Thanks in advance.
tb1
id m t w th f s
1 1 0 0 1 0 0
2 0 1 0 0 1 0
3 1 0 1 0 1 0
I'm trying to get a result set to look like
id Day
1 Monday
1 Thursday
2 Tuesday
2 Friday
3 Monday
3 Wednesday
3 Friday
I'm using the following:
select id,
case WHEN m <> 0 THEN 'Monday'
when t <> 0 then 'Tuesday'
when w <> 0 then 'Wednesday'
when th <> 0 then 'Thursday'
when f <> 0 then 'Friday'
when s <> 0 then 'Saturday'
ELSE 'None' end
from tb1
my result set looks like
id Day
1 Monday
2 Tuesday
3 Monday
How can I get the other days?
Thanks in advance.