|
Posted by Tom Moreau on 06/02/06 13:14
Try:
SELECT Mat,
Dur
FROM MAND
GROUP BY Mat, Dur
HAVING SUM (CASE WHEN Dur = 'i' THEN 1 ELSE 0 END) = 0
--
Tom
----------------------------------------------------
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Toronto, ON Canada
..
<daoud97@yahoo.com> wrote in message
news:1149251877.853856.250370@y43g2000cwc.googlegroups.com...
daoud97@yahoo.com schreef:
> markc600@hotmail.com schreef:
>
> > SELECT Mat,
> > 'd' AS Dur
> > FROM MAND
> > GROUP BY Mat
> > HAVING COUNT(*)=2 AND COUNT(DISTINCT Dur)=1
>
> Sorry, it's not correct :
>
> if i insert
>
> 36000 i
> 36000 i
>
> and apply your SQL, i have some result like :
>
> 10000 d
> 16030 d
> 31217 d
> 36000 d (????)
>
> perhaps, i d'ont expline vers well !
I will try to expline more :
this is the table with groups:
Mat Dur
16030 d
16030 i
31217 i
31217 d
31217 d
31217 d
10000 d
10000 d
10000 d
35000 d
I'am interested only by the 2 groups : 1000 and 35000 because the
haven't any 'i' in the colonn Dur.
Navigation:
[Reply to this message]
|