Home » SQL & PL/SQL » SQL & PL/SQL » Need help in formatting the displayed result
Need help in formatting the displayed result [message #267720] Fri, 14 September 2007 06:27 Go to next message
vamsikgummadi
Messages: 62
Registered: April 2006
Location: United States, MI
Member
Hello friends,
I am working on a project and I need help from you all.

Explanation of the query:

SELECT * FROM EMP E, DEPT D
WHERE E.DEPTNO=D.DEPTNO
GROUP BY D.DEPTNO

After execution of the result I may get the o/p as follows:

Empno ename deptno
1 Scott 10
2 woods
3 john 20
5 williams
8 james
10 remo
11 stella 40 Now the problem is I need to display my result in the manner given below:
empno ename deptno
1 2 scott woods 10
3 5 8 10 john williams james remo 20
11 stella 40


Is there any way to display the result in the above mentioned format? If yes, please send me the code snippets for displaying the result in this format. Please don't use concatenation because I need to display all these values in separate cells. Once if you can help me I can use the same in my project and there after push this data to data grid.

Hope you can solve this and forward your suggestions.

Thanks and regards,
Vamsi K Gummadi.

[Updated on: Fri, 14 September 2007 07:35] by Moderator

Report message to a moderator

Re: Urgent: Need help in formatting the displayed result [message #267728 is a reply to message #267720] Fri, 14 September 2007 06:49 Go to previous message
Michel Cadot
Messages: 64153
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Yes, use a pivot method which can be found here, on AskTom, on SnippetJoe site...

In addition,
Please read and follow OraFAQ Forum Guide, especially "How to format your post?" section.
Make sure that lines of code do not exceed 80 characters when you format. Use the "Preview Message" button.
Please always post your Oracle version (4 decimals).

Regards
Michel

[Updated on: Fri, 14 September 2007 06:49]

Report message to a moderator

Previous Topic: Problem with Procedure
Next Topic: First Day Of A Given Week
Goto Forum:
  


Current Time: Sun Dec 11 02:42:04 CST 2016

Total time taken to generate the page: 0.12210 seconds