I have four different tables with answers from surveys. I need to check the answers for all of the question so that they make sense and can be used for research.
So far a have been doing this:
select F1, count(F1)
from table
group by F1;
The problem is that it's a lot of questions and i have to change that column name (F1) everywhere i use it. The above example is the most simple question, but often i need to to more complicated queries to determine how this answers differ over the 4 different tables.
That i'm looking for is some thing like this
columnName = F1
select columnName, count(columnName)
from table
group by columnName;
Now i can easily change the column name in one place. this would save me a lot of time.
Any suggestions?