Posted by daoud97@yahoo.com on 06/02/06 13:06
markc600@hotmail.com schreef:
> SELECT Mat,
> 'd' AS Dur
> FROM MAND
> GROUP BY Mat
> HAVING COUNT(*)=2 AND COUNT(DISTINCT Dur)=1
> AND MAX(Dur)='d'
sorry, it's not correct
Example:
16030 d
16030 d
31217 d
10000 d
12000 i
10000 d
31217 d
35000 d
36000 i
35000 d
35000 d
36000 i
45 d
45 d
45 i
250 d
250 i
10 i
10 i
result with your query :
10000 d
16030 d
31217 d
reult that i need:
10000 d
16030 d
31217 d
35000 d
why COUNT(*)=2 ?
Navigation:
[Reply to this message]
|