Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 CountRows in InnerJoinTable

Author  Topic 

Gerten_Utv
Starting Member

7 Posts

Posted - 2010-10-05 : 03:49:26
Hi I have an tabel bo_Match and bo_MatchResult
Senario select alla rows from bo_Match where rows in bo_MatchResult < 9

SELECT * FROM bo_Match INNER JOIN bo_MatchResult ON (MatchId = MatchResultMatchId)
WHERE MatchSeason = 2010 AND MatchDivisionId = 8

Best regards
Gert

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2010-10-05 : 04:00:54
select *
from bo_Match bm
join
(select MatchResultMatchId from bo_MatchResult group by MatchResultMatchId having count(*) < 9) dt
on dt.MatchResultMatchId = bm.MatchId


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page
   

- Advertisement -