how to transform comma separated column into multiples rows in db2
问题 I have the following table (the number of the references is variable): Id | FK_ID| Reference | ----------------------- 1 2100 GI2, GI32 2 2344 GI56 And I need the following result: Id | FK_ID| Reference | ----------------------- 1 2100 GI2 2 2100 GI32 3 2344 GI56 Is there any short way to transform the data like this using DB2? 回答1: You really should not be storing data like this. Fortunately, there is a way to undo the damage with recursive SQL, something along these lines: WITH unpivot (lvl