Click here to Skip to main content
15,886,518 members
Home / Discussions / Database
   

Database

 
AnswerRe: check the key value before inserting data Pin
PIEBALDconsult1-Jul-11 14:16
mvePIEBALDconsult1-Jul-11 14:16 
GeneralRe: check the key value before inserting data Pin
Eddy Vluggen2-Jul-11 0:10
professionalEddy Vluggen2-Jul-11 0:10 
AnswerRe: check the key value before inserting data [modified]---ALREADY SOLVED--- Pin
Niladri_Biswas3-Jul-11 23:49
Niladri_Biswas3-Jul-11 23:49 
QuestionSSRS Help Pin
Aptiva Dave28-Jun-11 3:31
Aptiva Dave28-Jun-11 3:31 
AnswerRe: SSRS Help Pin
Mycroft Holmes28-Jun-11 18:09
professionalMycroft Holmes28-Jun-11 18:09 
GeneralRe: SSRS Help Pin
Aptiva Dave29-Jun-11 8:25
Aptiva Dave29-Jun-11 8:25 
QuestionRun Package Parameters Pin
Groulien27-Jun-11 3:36
Groulien27-Jun-11 3:36 
QuestionAssist to solve this problem? [modified] Pin
current199924-Jun-11 22:41
current199924-Jun-11 22:41 
Please can anyone assist me with the following questions?
1. Given the following table (the data could be hundreds of rows):


CompanyID CompanyName Town Country CompanySize
1 CompanyA Maryland USA 10
2 CompanyB Maryland USA 19
3 CompanyC Maryland USA 20
4 CompanyD Texas USA 13
5 CompanyE Texas USA 40
6 CompanyE Florida USA 4


For those towns which have more than one company in them, calculate (in one query):
· The total number of employees in the town.
· The average number of employees in a company (per town).
· The average number of employees in a company (per town) only for companies which
have less than 20 employees.
The results should exclude Florida and be sorted in descending order of the total number of
employees in the town.

I will be very grateful for your professional response.
Regards,
Current


Addendum
I forgot to mention that CompanySize is the number of employees
Thanks for your observation.

modified on Saturday, June 25, 2011 7:20 AM

AnswerRe: Assist to solve this problem? Pin
Blue_Boy25-Jun-11 1:10
Blue_Boy25-Jun-11 1:10 
AnswerRe: Assist to solve this problem? Pin
current199925-Jun-11 1:22
current199925-Jun-11 1:22 
AnswerRe: Assist to solve this problem? Pin
Mycroft Holmes25-Jun-11 2:35
professionalMycroft Holmes25-Jun-11 2:35 
GeneralRe: Assist to solve this problem? Pin
current199925-Jun-11 3:22
current199925-Jun-11 3:22 
GeneralRe: Assist to solve this problem? Pin
Mycroft Holmes25-Jun-11 3:34
professionalMycroft Holmes25-Jun-11 3:34 
GeneralRe: Assist to solve this problem? Pin
current199925-Jun-11 6:19
current199925-Jun-11 6:19 
GeneralRe: Assist to solve this problem? Pin
Mycroft Holmes25-Jun-11 13:06
professionalMycroft Holmes25-Jun-11 13:06 
GeneralRe: Assist to solve this problem? Pin
Peter_in_278026-Jun-11 14:50
professionalPeter_in_278026-Jun-11 14:50 
GeneralRe: Assist to solve this problem? Pin
Mycroft Holmes26-Jun-11 14:56
professionalMycroft Holmes26-Jun-11 14:56 
GeneralRe: Assist to solve this problem? Pin
David Skelly26-Jun-11 22:29
David Skelly26-Jun-11 22:29 
AnswerRe: Assist to solve this problem? Pin
Blue_Boy25-Jun-11 21:42
Blue_Boy25-Jun-11 21:42 
GeneralRe: Assist to solve this problem? [modified] Pin
current199917-Jul-11 21:48
current199917-Jul-11 21:48 
AnswerRe: Assist to solve this problem? Pin
Niladri_Biswas4-Jul-11 0:44
Niladri_Biswas4-Jul-11 0:44 
GeneralRe: Assist to solve this problem? Pin
current199918-Jul-11 0:00
current199918-Jul-11 0:00 
QuestionStored procedure from SSIS Pin
Groulien24-Jun-11 0:11
Groulien24-Jun-11 0:11 
AnswerRe: Stored procedure from SSIS Pin
R. Giskard Reventlov24-Jun-11 1:57
R. Giskard Reventlov24-Jun-11 1:57 
AnswerRe: Stored procedure from SSIS [modified] Pin
UNCRushFan24-Jun-11 2:03
UNCRushFan24-Jun-11 2:03 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.