Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Subquery with Deleted() does not work?
Message
 
 
To
15/09/2009 09:35:48
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01424502
Message ID:
01424508
Views:
41
>This query does not return any results, but I know the temp cursor has deleted records that are in the real table.
>
>
> Select * from JobItems where ipkey in (Select ipkey From csrTempJobItems Where Deleted()=.T.)
>
>
>If I run the subquery by itself, I do get the desired results for the subquery, so I do not understand why it does not work in the full query shown above:
>
> Select ipkey From csrTempJobItems Where Deleted()=.T.
>
If you split this in two selects:
Select ipkey From csrTempJobItems Where Deleted()=.T. into cursor cDeleted nofilter

select * from JobItems where exists (select 1 from cDeleted where cDeleted.IpKey = JobItems.JpKey)
would it return the result?

Though I agree with Sergey that it may be better to use a different field to mark deleted records.
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform