Nabil Sayegh <nsmail@sayegh.de> writes:
> On 05 Jun 2001 17:01:14 -0500, Manuel Sugawara wrote:
> >
> > something like
> >
> > select * from events where ref in (select distinct ref from events limit 3);
> >
> > will do what you want.
>
> Not exactly, he wanted the NEXT 3 events.
OK, I see; is not that simple eh?, but here is another idea, create a
view, something like:
create view events_v as select distinct on (ref) * from events where date >= now();
and then select limited to 3
select * from events_v order by date limit 3;
This may not do exactly what he wants but is closest solution i can
imagine ;-)
regards,
Manuel.