>>>>
>>>>town fullname dateBeg DateEnd
>>>>
>>>>town1 fullname1 date1 date2
>>>>town1 fullname1 date3 date4
>>>>
>>>>townN fullname1 date1N date2N
>>>>townN fullname1 date3N date4N
>>>>
>>>>
>>>>We need info from this table for each town code, which corresponds to max dateEnd
>>>
>>>Nadya,
>>>Still can't see what's different.
>>>Cetin
>>
>>You don't have Group BY in your original example.
>
>Why should I have it ?
>Cetin
Because I changed the definition of original problem to make it a little bit more complicated. We need to find information about each town record, which has a maximum date. So, we have to group on towns...
Anyway, it looks like you're refusing to provide an answer :) I guess, I can solve this problem myself or already solved it. Just thought, that the solution could be of interest to others...
If it's not broken, fix it until it is.
My Blog