Home » SQL & PL/SQL » SQL & PL/SQL » joins and rollup (AB INITIO)
joins and rollup [message #399294] Tue, 21 April 2009 08:34 Go to next message
rohitupgzp
Messages: 11
Registered: August 2008
Junior Member
I have two files say emp (empid,ename)
and empwork (empid,projectid,workinghours,amount)

I want third out put as

empid,name, projectid, sum(amount),sum(workinghours)

Can anyone help me with what components should be used and in what order.

Regards
Rohit Sinha
Re: joins and rollup [message #399570 is a reply to message #399294] Thu, 23 April 2009 01:00 Go to previous messageGo to next message
delna.sexy
Messages: 941
Registered: December 2008
Location: Surat, The Diamond City
Senior Member
Join two tables using column 'empid'.
Group the result on 'empid,projectid'.
And use aggrigate function SUM.
To dispaly 'ename' use co-related sub-query.

regards,
Delna
Re: joins and rollup [message #399748 is a reply to message #399570] Thu, 23 April 2009 21:41 Go to previous message
Kevin Meade
Messages: 2101
Registered: December 1999
Location: Connecticut USA
Senior Member
Pick up a book about sql and learn it. SQL for Dummies comes to mind.

I am not attempting to diss you, this is a real book and an easy introduction to the language. It will cover exactly what you have asked.

Good luck, Kevin
Previous Topic: PL/SQL/Oracle...quick online tutorial needed
Next Topic: handling collection type (merged 3)
Goto Forum:
  


Current Time: Sat Dec 03 05:59:51 CST 2016

Total time taken to generate the page: 0.21935 seconds