Home » SQL & PL/SQL » SQL & PL/SQL » need query based on the below requirement (Oracle 10g)
need query based on the below requirement [message #635061] Thu, 19 March 2015 11:37 Go to next message
vasu.bods703
Messages: 1
Registered: March 2015
Location: Chennai
Junior Member
Hi,
I have a table with 2 columns(EMPID,SAL).I want to write a query based on those 2 columns,and my query should be like this
EMPID,COUNT OF EMPLOYEE WHO HAS LESS SALARY THEN EACH EMPLOYEE

My table is

EMPID,SAL
A,10000
B,20000
C,30000
D.40000


Thanks&Regards,
Vasu.
Re: need query based on the below requirement [message #635062 is a reply to message #635061] Thu, 19 March 2015 11:40 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:

http://www.orafaq.com/forum/t/88153/0/ and read http://www.orafaq.com/forum/t/174502/
Re: need query based on the below requirement [message #635063 is a reply to message #635061] Thu, 19 March 2015 11:41 Go to previous messageGo to next message
John Watson
Messages: 8931
Registered: January 2010
Location: Global Village
Senior Member
This looks like a college homework question, yes? No-one will goive you the answer, but if you show what you have tried so far, you will get advice.

Before you reply, be sure to read about [code] tags. And then post the code need to create your table and insert those rows, and what SELECT you have tried. Hint: think sub-queries.
Re: need query based on the below requirement [message #635066 is a reply to message #635061] Thu, 19 March 2015 12:42 Go to previous messageGo to next message
joy_division
Messages: 4963
Registered: February 2005
Location: East Coast USA
Senior Member
vasu.bods703 wrote on Thu, 19 March 2015 12:37

EMPID,COUNT OF EMPLOYEE WHO HAS LESS SALARY THEN EACH EMPLOYEE


American english is my first and only language. I do not understand what that means. We will need a full expalanation with output expected.
Re: need query based on the below requirement [message #635069 is a reply to message #635066] Thu, 19 March 2015 13:28 Go to previous messageGo to next message
Michel Cadot
Messages: 68645
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

English is not my first language so there are some chances I can translate OP's sentence given my own usual errors. Smile
THEN -> THAN
EACH -> THIS

but maybe OP has not the same usual errors. Wink



Re: need query based on the below requirement [message #635070 is a reply to message #635069] Thu, 19 March 2015 13:34 Go to previous message
joy_division
Messages: 4963
Registered: February 2005
Location: East Coast USA
Senior Member
Michel Cadot wrote on Thu, 19 March 2015 14:28

THEN -> THAN
EACH -> THIS


THEN to THAN was easy, but EACH could mean EVERY, changing its meaning.
Previous Topic: Need to identify columns not referenced in UPDATE SET clause.
Next Topic: EXISTS SQL QUERY
Goto Forum:
  


Current Time: Wed Apr 24 18:02:07 CDT 2024