Click here to Skip to main content
15,919,245 members
Home / Discussions / Database
   

Database

 
GeneralRe: Connect to MySQL Pin
dkeenaghan16-Aug-06 2:27
dkeenaghan16-Aug-06 2:27 
AnswerRe: Error connecting to Access DB: "Could not find installable ISAM" Pin
Stephen McGuire16-Aug-06 7:27
Stephen McGuire16-Aug-06 7:27 
QuestionQuestion of beginer Pin
papa8015-Aug-06 22:20
papa8015-Aug-06 22:20 
AnswerRe: Question of beginer Pin
Colin Angus Mackay15-Aug-06 23:21
Colin Angus Mackay15-Aug-06 23:21 
GeneralRe: Question of beginer Pin
papa8016-Aug-06 3:55
papa8016-Aug-06 3:55 
GeneralRe: Question of beginer Pin
Colin Angus Mackay16-Aug-06 5:15
Colin Angus Mackay16-Aug-06 5:15 
GeneralRe: Question of beginer Pin
papa8016-Aug-06 22:55
papa8016-Aug-06 22:55 
GeneralRe: Question of beginer [modified] Pin
i.j.russell17-Aug-06 3:26
i.j.russell17-Aug-06 3:26 
Colin Angus Mackay wrote:
SELECT Employer.Name, CustomerCount.NumCustomersFROM EmployerINNER JOIN (SELECT IdEmployer, COUNT(*) AS NumCustomers FROM CustomerEmployer) AS CustomerCountON CustomerCount.IdEmployer = Employer.IdEmployer


You need to add ORDER BY CustomerCount.NumCustomers DESC to give you the maximum first. To get only the maximum, use SELECT TOP 1 Employer.Name, etc.

SELECT TOP 1 Employer.[Name], CustomerCount.NumCustomers
FROM Employer INNER JOIN (SELECT IdEmployer, COUNT(*) AS NumCustomers
FROM CustomerEmployer
GROUP BY IdEmployer) AS CustomerCount
ON CustomerCount.IdEmployer = Employer.IdEmployer
ORDER BY CustomerCount.NumCustomers DESC

Ian


-- modified at 9:26 Thursday 17th August, 2006
GeneralRe: Question of beginer Pin
papa8017-Aug-06 21:09
papa8017-Aug-06 21:09 
QuestionOledb or Odbc Pin
NasimKaziS15-Aug-06 19:30
NasimKaziS15-Aug-06 19:30 
AnswerRe: Oledb or Odbc Pin
Colin Angus Mackay15-Aug-06 23:15
Colin Angus Mackay15-Aug-06 23:15 
QuestionMS SQL SERVER Transaction Log Pin
jrbvillanueva15-Aug-06 17:12
jrbvillanueva15-Aug-06 17:12 
AnswerRe: MS SQL SERVER Transaction Log Pin
Stephen McGuire16-Aug-06 7:11
Stephen McGuire16-Aug-06 7:11 
AnswerRe: MS SQL SERVER Transaction Log Pin
Mike Dimmick16-Aug-06 16:49
Mike Dimmick16-Aug-06 16:49 
QuestionSQL self join question Pin
Asad Hussain15-Aug-06 9:57
Asad Hussain15-Aug-06 9:57 
AnswerRe: SQL self join question Pin
Farhan Noor Qureshi15-Aug-06 12:28
Farhan Noor Qureshi15-Aug-06 12:28 
GeneralRe: SQL self join question Pin
Asad Hussain16-Aug-06 6:05
Asad Hussain16-Aug-06 6:05 
AnswerRe: SQL self join question Pin
Eric Dahlvang17-Aug-06 3:31
Eric Dahlvang17-Aug-06 3:31 
GeneralMS SQL Server Management Studio Express Pin
Bassam Abdul-Baki15-Aug-06 7:25
professionalBassam Abdul-Baki15-Aug-06 7:25 
GeneralRe: MS SQL Server Management Studio Express [modified] Pin
Farhan Noor Qureshi15-Aug-06 12:30
Farhan Noor Qureshi15-Aug-06 12:30 
GeneralRe: MS SQL Server Management Studio Express Pin
Bassam Abdul-Baki16-Aug-06 2:44
professionalBassam Abdul-Baki16-Aug-06 2:44 
Questionhow to select dimension members from data cube Pin
cellardoor071615-Aug-06 3:15
cellardoor071615-Aug-06 3:15 
Questiongetting a value out of a dataset Pin
Glen Harvy14-Aug-06 20:35
Glen Harvy14-Aug-06 20:35 
AnswerRe: getting a value out of a dataset Pin
Farhan Noor Qureshi15-Aug-06 12:32
Farhan Noor Qureshi15-Aug-06 12:32 
Questionhow to bulk insert into excel? Pin
steven_wong14-Aug-06 16:49
steven_wong14-Aug-06 16:49 

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.