Is it possible in any way (without scripting) to aggregate columns which are stored in a table cell.
Basically what i am trying to achieve here is that if i have the following table
Table 1
KEYNAME | COLUMN_NAME
COUNT_USER | USER_ID
SUM_HOURS | HOURS_WATCHED
Can i do something like
select SUM((select column_name from TABLE1 where KEYNAME = "SUM_HOURS")) FROM MAIN_TABLE
I have the option to script in python via which i know how to achieve this. But i am curious to know if this is possible in any version of SQL or not Please let me know if the information is insufficient.