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!

A list of the top 10 industries that are enrolled with company

Status
Not open for further replies.

report2000

Technical User
Mar 1, 2005
45
0
0
US
I would like to be able to query my industry table and see the ist of the top 10 (not first 10 records)industries that are enrolled with
my company
 
Report2000, that sounds like a righteous desire to me. It would help us help you if you could disclose specific tables, columns, and criteria by which you determine the "Top 10 Industries" enrolled with your company.

[santa]Mufasa
(aka Dave of Sandy, Utah, USA)
[I provide low-cost, remote Database Administration services: www.dasages.com]
 
Here u go. this is the qury stucture. How can I group the industrycode so thwn i can pick up the top 10 industry

select
company.userid,
company.companyName,
Industry.industrycode,
indusrty.idustryName
from
company company
industry industry
where
company.indusrtycode = industry.industrycode
 
You never gave the criterea for what is a top 10 company, but I will dummy up a test case.

select *
from
(select
company.userid,
company.companyName,
Industry.industrycode,
indusrty.idustryName
from
company company
industry industry
where
company.indusrtycode = industry.industrycode
order by company.ranking)
where rownum < 11;

Bill
Oracle DBA/Developer
New York State, USA
 
Beilstwh has given you a good start, but how do you rank the top ten? Sales dollars? Sales quantities? Profitability?

-------------------------
The trouble with doing something right the first time is that nobody appreciates how difficult it was - Steven Wright
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top