,我有以下數據:拆分一行到多行基於列的值DB2
Sr no....EMP_ID....Location...Period1....Value1....Period2....Value2....Period3....Value3
...1......Emp001....India........Salary.....10000.....Bonus.....1000.......Bonus code...AB
...2......Emp002....UK...........Salary.....20000.....Bonus.....2000.......Bonus code...CD
我想要的輸出是這樣的:
Sr no....EMP_ID....Location....Period...Value
....1......Emp001....India.......Salary.....10000
....2......Emp001....India.......Bonus.....1000
....3......Emp001....India.......Bonus Code.....AB
....4......Emp002....UK.......Salary.....20000
....5......Emp002....UK.......Bonus.....2000
....6......Emp002....UK.......Bonus Code.....CD
您正在使用哪個數據庫,MySQL或DB2?你應該相應地標記你的問題。 –