Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
LIKE in subquery or subselect
Message
De
08/06/2010 11:48:00
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01467906
Message ID:
01467929
Vues:
53
>I am obviously deficient in the skill of search. This has got be be in the forum database somewhere, but ...
>
>I am having an issue with a simple SELECT statement in VFP SP1. The error that is being returned is :
>SQL: Error correlating fields.
>
>Can I have a LIKE in a subselect or subquery?
>
>Here is my statement:
>
>
>SELECT rawhits.hostaddy FROM rawhits ;								 
>WHERE EXISTS (SELECT 1 FROM exclhost WHERE exclhost.hostaddy LIKE rawhits.hostaddy)
>
vfp support simple correlated subquery only.

In practice, only those for which an index can be used in subquery.

You can try this
SELECT rawhits.hostaddy FROM rawhits ;
JOIN (SELECT DISTINCT  hostaddy FROM exclhost) X ON X.hostaddy LIKE rawhits.hostaddy
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform