Home » SQL & PL/SQL » SQL & PL/SQL » query needed without using only where clause (10g)
query needed without using only where clause [message #657308] Fri, 04 November 2016 19:08 Go to next message
god_bunu
Messages: 1
Registered: November 2016
Junior Member
Hi,
I have two tables Employee(Id, Name) and Salary (Id, month , sal).
Can I write a query that will select those employees whose cumulative salary (sum of salary for all months for that employee) is equal to or greater than 300, however display the results monthwise.
Re: query needed without using only where clause [message #657310 is a reply to message #657308] Fri, 04 November 2016 21:42 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
Welcome to this forum

Please read and follow the forum guidelines, to enable us to help you:
OraFAQ Forum Guide
How to use {code} tags and make your code easier to read

Re: query needed without using only where clause [message #657311 is a reply to message #657308] Sat, 05 November 2016 01:49 Go to previous messageGo to next message
Michel Cadot
Messages: 68643
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

Yes, you can.
We don't do homework, post what you already tried and explain where you are stuck.

Re: query needed without using only where clause [message #657312 is a reply to message #657308] Sat, 05 November 2016 02:00 Go to previous message
Michel Cadot
Messages: 68643
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

Hint: have a look at SUM function in its analytic form.

Also always post your Oracle version, with 4 decimals, as solution depends on it.

Previous Topic: Selecting the columns
Next Topic: package modified details
Goto Forum:
  


Current Time: Tue Apr 23 03:57:30 CDT 2024