by strawberry <zac.carey@[EMAIL PROTECTED]
>
Feb 5, 2008 at 02:34 PM
On Feb 3, 1:39 am, "S." <sianeag...@[EMAIL PROTECTED]
> wrote:
> Thanks Thomas,
>
> That was exactly what i was after!
>
> S.
5 stars! For that! Too generous! ;-)
I think there must be a solution that doesn't require a subquery but
my brains a bit frazzled today. I think it could be something along
these lines, but I'd have to extend the dataset to be sure:
SELECT t1.*
FROM orders t1
LEFT JOIN orders t2
ON t1.customer = t2.customer
AND t1.orderdate < t2.orderdate
AND t2.orderdate < '2007-12-20'
WHERE t2.id IS NULL
HAVING orderdate < '2007-12-20';