Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Update more limited than select?
Message
De
12/02/2008 05:19:41
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
01291690
Message ID:
01291730
Vues:
15
>This works
>
>SELECT * FROM mytable where;
> f1 in (SELECT f1 from look_up group by f1 having count(*) = 1) AND ;
> f2 in (select f2 from look_up group by f2 having count(*) = 1)
>
>
>and this fails
>
>update mytable set flag = "1" where;
> f1 in (SELECT f1 from look_up group by f1 having count(*) = 1) AND ;
> f2 in (select f2 from look_up group by f2 having count(*) = 1)
>
And you are very sure that the SELECT returns correct record but UPDATE didn't update all of them?
What happens with this:
update mytable set flag = "1";
FROM mytable;
 where f1 in (SELECT f1 from look_up group by f1 having count(*) = 1) AND ;
       f2 in (select f2 from look_up group by f2 having count(*) = 1)
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform