@Need a help in writing oracle query
I have a table Test with following information
DIM1 | DIM2 | DIM3 | DIM4 | DIM5 | DIM6 | SM1 | SM2 | SM3 | SM4 | SM5 | SM6 |
A | B | C | D | E | F | 1 | 2 | 3 | 4 | 5 | 6 |
A | B | C | D | E | F | 2 | 2 | 2 | 2 | 2 | 2 |
I would need data with sum row wise, I wrote this query it works.
select DIM1, DIM2,DIM3,DIM4,DIM5,DIM6,(SM1+SM2+SM3+SM4+SM5+SM6) from Test
But my requirement in table columns might increase, hence I would need this query to be dynamic, it should work though any additions or deletions in columns with out changing query.We are using Oracle 11g.
Thanks in advance.