SnowmanDeclare @A Table (B int, C int)
Insert Into @A Values(1, 114)
Insert Into @A Values(1, 124)
Insert Into @A Values(1, 126)
Insert Into @A Values(2, 114)
Insert Into @A Values(2, 124)
Insert Into @A Values(3, 114)
Insert Into @A Values(3, 126)
Insert Into @A Values(4, 114)
Insert Into @A Values(4, 124)
Insert Into @A Values(4, 126)
Select * From @A
Select B From
(Select Distinct B, C From @A) D
Group By B
Having Sum© = 364 /*Count(*) = 3*/
-------------------
კოპირაიტის მაგივრად C უნდა იყოს
This post has been edited by gion on 24 Jan 2009, 15:25