Why is WM _ concat reading in a random order?
I’m guessing this has something to do with the way WM_CONCAT functions. Even though the query that WM_CONCAT is reading would have it concatenate everything in the right order (assuming it was reading top-bottom), it seems to be reading things in more-or-less a random order.
Is there any trick I can use to get WM _ Concat to work properly?
Even though the query that WM_CONCAT is reading would have it concatenate everything in the right order (assuming it was reading top-bottom), it seems to be reading things in more-or-less a random order. Is there any trick I can use to get WM_CONCAT to work properly?
How to add distinct condition in WM _ concat?
For anyone that is still using wm_CONCAT (a.k.a. older db versions): The solution is to add distinct condition, it will then also apply ascending order to the concatenated values. Don’t ask why it’s not documented, but it will work.
How to sort WM _ concat output in Oracle?
We can also apply count with an order by to find out how many items have been concatenated and a count without the order by to get the total number of concatenated items. Having got this output, all we then have to do is apply a condition running_count=tot_count and we get the sorted output.
How to replace WM _ concat function in Oracle?
We are upgrading oracle from 11G to 12c and in one of our code we are using WM_CONCAT function. Concatenate the field values and remove duplicate entries for the same. This requirement is on multiple fields. We need the replacement for this. and we said… Sadly listagg doesn’t have a distinct option. But it does exclude null values.
Can you use VARCHAR2 with WM concat function?
Answer : Oracle Guru Laurent Schneider has this to add about the use of CAST and wm_concat: Regarding the results returned by wm_concat, The use of CAST does indeed resize or expand to the specified length. As for using varchar2 with the wm_concat results, it does not right pad with blank space.