Home » SQL & PL/SQL » SQL & PL/SQL » How to show all the data in a one row (oracle10g)
How to show all the data in a one row [message #391502] Thu, 12 March 2009 07:00 Go to next message
sr_orcl
Messages: 82
Registered: January 2009
Location: mumbai
Member

Hi to all,
This is my query It generates the correct result but not in proper format
I want data shuold be display like this,

EMPLOYEENAME 11G Feature Adhoc Request China
Anil K 0 1 37
Ankur Gupta 0 9 37
Avinash Gore 0 17 37
Jagadeesh 0 37

But my query generates result as attached in a file.Please give me some idea?

SELECT (b.en) employeename,
(Decode(b.tid,'309',b.tot)) test,
(Decode(b.tid,'310',b.tot)) employeee,
(Decode(b.tid,'311',b.tot)) bugfixing
FROM (SELECT a.en en,
a.tid tid,
Sum(a.tot_hrs_spent) tot
FROM (SELECT tm.taskid tid,
tm.taskdesc td,
e.employeename en,
Round(((Substr(et.totime,1,Instr(et.totime,':') - 1) * 60) + Substr(et.totime,Instr(et.totime,':') + 1) - (Substr(et.fromtime,1,Instr(et.fromtime,':') - 1) * 60) + Substr(et.fromtime,Instr(et.fromtime,':') + 1)) / 60) AS tot_hrs_spent,
Row_number()
OVER(PARTITION BY et.taskid ORDER BY tm.taskdesc) TOP
FROM employee_task_dtl et,
task_master tm,
employee e
WHERE et.taskid = tm.taskid
AND et.employeeid = e.employeeid/*AND et.employeeid = 26*/
) a
GROUP BY a.en,
a.tid) b
Re: How to show all the data in a one row [message #391514 is a reply to message #391502] Thu, 12 March 2009 07:32 Go to previous messageGo to next message
pablolee
Messages: 2834
Registered: May 2007
Location: Scotland
Senior Member
Please edit and reformat your post using the techniques described in the Posting guidelines i.e. use [code] [/code] tags around that which you want formatted
Re: How to show all the data in a one row [message #391525 is a reply to message #391502] Thu, 12 March 2009 07:49 Go to previous messageGo to next message
joy_division
Messages: 4640
Registered: February 2005
Location: East Coast USA
Senior Member
sr_orcl wrote on Thu, 12 March 2009 08:00
It generates the correct result but not in proper format


How ironic.

Ok, so you say it doesn't display in the correct format. God help us if we know what format you want. My argument is that is does indeed display in the correct format. Problem solved.
Re: How to show all the data in a one row [message #401353 is a reply to message #391525] Mon, 04 May 2009 03:31 Go to previous message
sr_orcl
Messages: 82
Registered: January 2009
Location: mumbai
Member

hi,
my problem is solved.thanks a lot...
Previous Topic: Parallel execution of Procedure.
Next Topic: Using UTL_TCP with SSL
Goto Forum:
  


Current Time: Sat Dec 03 00:59:57 CST 2016

Total time taken to generate the page: 0.11558 seconds