Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Subquery with Deleted() does not work?
Message
 
 
À
15/09/2009 09:35:48
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9 SP2
Database:
Visual FoxPro
Divers
Thread ID:
01424502
Message ID:
01424508
Vues:
42
>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform