>>>BTW why you need CTE for this?
>>>You can use Derived tables :-)
>>
>>Thanks, it is a recursive CTE as discussed in an earlier thread a few days ago.
>>
>>I have never heard of derived tables, so I guess I've got some more research to do.
>
>
>Derived tables are not recursive.
>You must use CTEs in that case :-)
Just checked out what a derived table is and realise I hav ebeen using them for many years without knowing the term to describe them! :)