How to concatenate multiple rows in Oracle
There are a few scenarios where we want to create a list of entries or list of entries within a group or list of unique entries or anything related to list. So, the question stands still, How to concatenate multiple rows in Oracle?
Answer to this is ListAgg. It concatenate multiple rows to a single string separating different values user defined delimiter. The output of listagg can be used in many real-time scenarios, for example, passing list of unique accounts to a subquery
Let’s dive in, we will be using a table called GROCERY which has different products, expiration status, product’s price, and expiry date.