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!

Order by in Oracle using group by for ordering...

Status
Not open for further replies.

new2apache

Programmer
Mar 13, 2002
4
US
I need something similar to following

select * from table
where columX in (dat1,data2,...)
order by (sum (colum1 * colum2) group by colum3)

Is this possible? and what would be its syntax?

Basically how can I order the query result based on the sum of a column and this sum should be grouped by another column.
If anyone can help me that'd be great.
I hope my explaination is good enough for all to understand. I know its too complex even to explain :)
Thanks
Amar
 
the following works fine
select sum(QTY * PRICE) as TotalVal, supplierid
from BIDS
where awardID in(2,3)
group by supplierid
order by TotalVal

But I need all the fields from this table ('BIDS') and ordered by 'TotalVal'.
I hope this explains it better than previous post.
Please, at least let me know if this is possible or not? So that I'll stop wasting time to build this query. And use this time to work on other programatic approach.
Thanks,
Amar
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top