>>I see - a bit tricky. I solved a similar problem with recursive cte (see
http://blogs.lessthandot.com/index.php/DataMgmt/DataDesign/cte-and-hierarchical-queries - though it doesn't work for best fitting).
>>
>>I think you may be better with dbase solution here rather than SQL.
>
>Argh. This is beyond my level - and I can't do it with VFP anyway. So we stuck to SCAN and LOCATE. (-.-)
>
>Agnes
I'm just thinking it can be better solved with procedural code than with one or two select statements.
If it's not broken, fix it until it is.
My Blog