![]() | |
#11
| |||
| |||
|
|
Thanks Thomas, That was exactly what i was after! S. |
#12
| |||
| |||
|
|
Thanks Thomas, That was exactly what i was after! S. |
#13
| |||
| |||
|
|
Thanks Thomas, That was exactly what i was after! S. |
#14
| |||
| |||
|
|
On Feb 3, 1:39 am, "S." <sianeag... (AT) gmail (DOT) com> 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'; |
#15
| |||
| |||
|
|
On Feb 3, 1:39 am, "S." <sianeag... (AT) gmail (DOT) com> 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'; |
#16
| |||
| |||
|
|
On Feb 3, 1:39 am, "S." <sianeag... (AT) gmail (DOT) com> 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'; |
![]() |
| Thread Tools | |
| Display Modes | |
| |