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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Select Information from a Table

Status
Not open for further replies.

getjbb

MIS
Jun 4, 2003
139
US
I have a situation where a person can have more then one item ordered. I need to layout the information as follows:

Person Item Ordered Item Description
----------------------------------------------
1 1 of 2 Notepads
1 2 of 2 Rulers
2 1 of 1 Crayon
3 1 of 3 Pencils
.
.

The information is in the same table.
If anyone could help me it would be appreciated

getjbb
 
Not being funny, but

Notepads + Rulers + Crayon + Pencils = Homework

to me at least, and as such isn't allowed in Tek-Tips.

I want to be good, is that not enough?
 
I am not a student. I am a Programmer Analyst who need help in creating a select statement. I chose school supplies, because it was the first things I could think of. Trust me I am not a student and do not wish to be one at this time.

getjbb
 
Of course, getjjb could work for a stationery company.[smile]

Code:
select person,
to_char(row_Number() over (partition by person order by item))||' of '||to_char(count(item) over (partition by person)) as item_ordered, item_desc
from items
 
Fair enough. At least there was no mention of ACME widgets I guess ;-)

I want to be good, is that not enough?
 
Thanks for believing in me and a solution. Have a nice day.

ponderena
 
Hey Dagon,
Check out his post here...

thread183-1391668

to bad for him, your solution, (which is very good) won't work on his dev server.

- Paul
- If at first you don't succeed, find out if the loser gets anything.
 
Developing in SQL*Server but implementing in Oracle...

That is the most ludicrous thing I've ever heard. Did the person who came up with that idea get paid for it ?

 
I know, That is crazy!
getjbb is going to need to getjob after this project gets implemented.

- Paul
- If at first you don't succeed, find out if the loser gets anything.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top