Hi, I am trying to write a query, my details are as below: Table: SerialNumbers, single values with 1-n rows. Example 14564864685 48434564641 14515 16987561 48949948648 I currently have the following query: SELECT wm_concat(serial_no) from SerialNumbers group by rownum - mod(rownum-1,5) This currently returns the following: 14564864685,48434564641,14515,16987561,48949948648 Because the length of my serial no could be anything from 4 digits to maybe 30, I want to check the length of the resulting string from the wm_concat function (with the "group by" 5) and if its longer than a certain number of characters then split a line. Is this possible? So I want it to look something like below: 14564864685,48434564641, 14515,16987561, 48949948648 I am unable to think of a solution. I cannot use PL/SQL here it has to be SQL... Hoping somebody can come up with something! Kind regards, Dom p.s. if this is in the wrong forum I apologise!