Timeline for How to create a query to get the multiple row data in comma separated format in one row in Oracle
Current License: CC BY-SA 4.0
9 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Apr 8, 2020 at 11:59 | history | edited | halfer | CC BY-SA 4.0 |
Trim please-help pleading
|
| May 9, 2019 at 9:45 | vote | accept | Ashutosh | ||
| May 8, 2019 at 11:59 | answer | added | Gordon Linoff | timeline score: 1 | |
| May 8, 2019 at 5:44 | comment | added | wavery | Hi Ashutosh, there is something odd about your data in that CODEDESC looks like a normal table but POLICY does not because of having multiple values with commas in between. There is probably a way to do what you want but we need more information. It almost looks like someone pulled NOTECODE and DESCRIPTION out of some other table and concatenated the values with a ",". | |
| May 8, 2019 at 5:42 | comment | added | Kaushik Nayak | Moreover, It's not that I or anybody else here can't provide a solution to your problem. You'll find many such already answered each day. But, considering numerous questions on SO asking solutions to this problem regularly, it becomes imperative to assert the importance of following the rules of normalisation. It is to avoid programmers from encountering such issues frequently and also to assist them in building better systems. | |
| May 8, 2019 at 5:32 | comment | added | Kaushik Nayak | Now is the right time. I understand that it was someone else's bad design decision that ended up with this problem, but changing that now will go long way to help future programmers including you. Trust me, you will keep facing problems because of this flawed table structure for ages to come. Read this answer which reiterates this fact. | |
| May 8, 2019 at 5:24 | comment | added | Ashutosh | Hi Kaushik, Normalizing the table is not possible right now. Have to handle it in query | |
| May 8, 2019 at 4:55 | comment | added | Kaushik Nayak | Normalize your tables. Storing the values as comma separated string is in violation of basic rules of a Relational database. | |
| May 8, 2019 at 4:28 | history | asked | Ashutosh | CC BY-SA 4.0 |