Okay, I've got a table of a survey that holds one record for every user question response, like below.AnswerID UserID Question Answer-------------------------------------------100 10 q01_a 213 101 10 q01_b 32102 10 q01_locked 1103 10 q02_1_a 56104 10 q02_1_b 118105 10 q02_1_c 67106 27 q02_1_a 400107 27 q02_1_b 0108 27 q02_1_c 81109 27 q02_1_locked 19
Records with "_locked" in the question field indicate that a user has submitted data for a particular section. What I'm trying to do is create a view of all locked data. In other words, when I find the record with "q01_locked," I want all of that user's records with "q01_*" - and so on.I can get a list of locked sections with something like this:SELECT UserID, REPLACE(Question, '_locked', '') AS questionBaseFROM tblAnswersWHERE (question LIKE '%_locked')
but then I would need to use a LIKE operator over each of the records from the subquery, correct? Any ideas? Many thanks,James