>>Sergey/Cetin
>>
>>>I agree with Cetin, it cannot be done with one query w/o subqueries.
>>
>>I'd kinda come to that conclusion myself last week after tearing my hair out for 2 days. I was just hoping that soemone more au fait with (basic) SQL might have an idea. I think I'll need to do it in code with do loops. What a pain!
>>
>>Thanks again for your efforts and trouble
>>
>>Terry
>
>In code? You have chance to code with do loops? Then create a temp table for MB?
Sure I can do it in code. Like I said, it's MapBasic. I'm having to do a LOT of this because of the inadequacies of its SQL. For instance, I needed to get all the details of certain bus stops. Now each stop record has FKs to the stop type, shelter type, timetable type, et al, look-up tables. MB SQL can't comfortably do more than 1 join, and certainly no more than 2. So a query I could achieve in one VFP SQL statment went on to take a page of code. A Real pain! I wanted to avoid such here, as I'm only looking at ONE table - but no can do! :-(
- Whoever said that women are the weaker sex never tried to wrest the bedclothes off one in the middle of the night
- Worry is the interest you pay, in advance, for a loan that you may never need to take out.