A couple of weeks a go I wrote a quick query to pull some data for me, something has been bothering me, is there a better way to find specific variants of something... Quick example:
SELECT FirstName, Surname, Quals1, Quals2, Quals3
Quals1 = @WantedQuals
Quals2 = @WantedQuals
Quals3 = @WantedQuals
OK, for instance, if @WantedQuals = 'A Levels' then it would return data if any of the Quals = 'A Levels'
But what if @WantedQuals = 'Level 3' is there an easy way to make it return for 'Level 1', 'Level2' & 'Level 3' but not 'Level 4', 'Level 5' or 'Level 6'....?
If memory serves me correctly I previously achieved it by using a case statement but it seems a bit of an ugly, dirty solution. Just wondering if there was a more eligant solution available...?
Hope that makes sence....