Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Select records with Maximum date group by address
Message
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00705983
Message ID:
00706010
Views:
27
Update By the way, we've been in production for several months already and we discovered this problem just few days ago! Our customers received incorrect data due to the wrongly written SQL statement...

>Hi Nadya,
>
>I would try.
select upper(CCODE+TOWN+STREET+str(STNUM,4)+STNUMEXT+UNIT) ;
>       as Address, * from (m.tcTableName) ;
>	WHERE  upper(CCODE+TOWN+STREET+str(STNUM,4)+STNUMEXT+UNIT) + DTOS(date) in ( ;
>       		SELECT Address + DTOS(maxdate) FROM curTemp)
>
I think, now you can combine two queries in one this way.
>

He-he, that's another variation, which I just wrote too. However, I don't think, it could be re-written as a single query. At least, I don't see it. Fortunately, in my case I can use two queries...

Both queries return identical results (inner join variation and sub-query variation), I think, sub-query is faster...
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform