oracle11g - Concatenating records when id is the same in Oracle -


I have an Oracle 11g database.

My table CHATUSERS looks like this:

  UserId - Identifier SeqNum - Chat conversation order chat text - Added chat text date - DateTime chat conversation occurred.  

A user can have multiple chat sessions in one day. I want to combine all per person per chat.

Example:

  UserId SeqNum added date ChatText --------------- ---------- ------- 1 1 28-October -14 Hey, how are you? 1 2 28-OCT-14 Do you have a minute? 1 3 28-Oct-14 wanted to talk to you about something 1 1 25-Oct-14 Congratulations! 1 2 25-OCT-14 on your promotion  

will return the selected query results:

  UserId, added date and full text 1 28-OCT - Hey, how are you? do you have a minute? Wish to talk to you about something 1 25-Oct-14 Congratulations!  

  

code> UserId, datedaided, LISTAGG (chat text , '') Choose;


Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -