I am stuck in situation where I need a comma separated list from group by result sets. Let me give you a typical schema :
username | lotno | img ------------------------ a | 0001 | 1.jpg ------------------------ a | 0001 | 2.jpg ------------------------ a | 0002 | 1.jpg ------------------------ a | 0002 | 2.jpg ------------------------ a | 0002 | 3.jpg ------------------------ b | 0003 | 1.jpg ------------------------
Now I want a group by result set like this :
<pre>
username | lotno | count
------------------------------
a | 0001, 0002 | 5
------------------------------
a | 0001 | 1
------------------------------
</pre>
How can I achieve this without writing a function or programming ? Can I do this using a query in Oracle. Do not mind, the table structure shown is drawn using tag. Thanks in advance.