Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Use Derived Field to group a range of Comprates together?

Status
Not open for further replies.

Atrzy

IS-IT--Management
Aug 18, 2003
11
US
My report lists employees by name, job, comprate, etc.

I want to group together all persons who earn between a certain rate of pay (comprate). For example, Group A would be between $7.00 and $9.00, Group B between $9.01 and $11.00, and so on (up to as many as 7 groups).

Can I do this with a derived field? If so, what do I use?
I am using Oracle.
 
I believe you can accomplish this with a string of multiple decodes. Assign a value for each of the 7 groups to group by.

DECODE(Greatest(x,y),x,1,y,2)

David L. Black Consulting
 
Depending on which version of Oracle you are running, you can actually use CASE.
 
Thanks obiwaugh,
I am on Orcale 9. I figured out the CASE statement earlier this week. It worked perfectly!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top