Not sure how to ask this as I’m a bit of a database noob,
What I want to do is the following.
table tb_Company table tb_Division
I want to return companies that have more than one division and I don’t know how to do the where clause.
SELECT dbo.tb_Company.CompanyID, dbo.tb_Company.CompanyName,
dbo.tb_Division.DivisionName FROM dbo.tb_Company INNER JOIN dbo.tb_Division ON
dbo.tb_Company.CompanyID = dbo.tb_Division.DivisionCompanyID
Any help or links much appreciated.
You’ll need another
JOINwhere you only return companies having more than one division by using aGROUP BYand aHAVINGclause.You can read up on grouping here