|
Posted by Generale Cluster on 05/04/06 17:07
markc600@hotmail.com ha scritto:
> You don't appear to have any criteria for
> the one row you want if there are more than one.
> If that's the case and log_id is unique, this should work
>
> select max(log_id),cust_id,type,service_id
> from log
> group by cust_id,type,service_id
>
It work great, thanks!
I got the same result with the following, but was much more complicated:
select *
from log a, log b
where a.cust_id='myid' and a.type IN (0,10,1) and a.log_id=b.log_id
and b.log_id IN (select top 1 log_id from log c where
c.service_id=a.service_id and c.type=a.type)
order by a.service_id
--
elimina carraro per rispondere via email
Navigation:
[Reply to this message]
|