wanderingaround
MIS
hello... my brain is worn out trying to figure this one out...
I have 2 fields (name, answer)
In my select statement I want to return I third column that states 'true' if at least one 'correct' exists (in the answer field).
something like:
Name Answer AtLeastOneCorrect
Andy wrong true
Andy wrong true
Andy correct true
Murray wrong
Murray wrong
Roger correct true
Roger correct true
As you can imagine... my attempt fails:
select name, answer,
case
when answer = 'correct' then 'true'
end
from TestScores
Any tips.. greatly appreciated!!!
I have 2 fields (name, answer)
In my select statement I want to return I third column that states 'true' if at least one 'correct' exists (in the answer field).
something like:
Name Answer AtLeastOneCorrect
Andy wrong true
Andy wrong true
Andy correct true
Murray wrong
Murray wrong
Roger correct true
Roger correct true
As you can imagine... my attempt fails:
select name, answer,
case
when answer = 'correct' then 'true'
end
from TestScores
Any tips.. greatly appreciated!!!