Can anyone give me some help as how to write a stored procedure to do counts across columns in a single table.
For example I have a table with columns drug1,drug2,drug3,drug4,drug5 all containing medication choices 1 to 5. I want to count for each medication across the columns so that I have a list detailing the medication and the number of users
eg
medication1 15
medication2 8
medication3 6
etc
I am a novice to SQL scripting
Can this be done?
For example I have a table with columns drug1,drug2,drug3,drug4,drug5 all containing medication choices 1 to 5. I want to count for each medication across the columns so that I have a list detailing the medication and the number of users
eg
medication1 15
medication2 8
medication3 6
etc
I am a novice to SQL scripting
Can this be done?