Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Update more limited than select?
Message
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:
01291729
Vues:
15
>>Since I've got data running through, and it's 4am and I'm a glutton I'll try to explain what I'm doing :) I want to flag records where the are no occurances of 2 different f1's to a f2 and vice versa
>>
>>lets put letters in f1 and numbers in f2
>>
>>f1 - a a a b b c d e f g g g h h h h i
>>f2 - 1 1 1 2 3 4 4 5 6 7 7 8 9 9 9 9 9
>>f3 - 0 0 0 1 1 1 1 0 0 1 1 1 1 1 1 1 1
>>
>>"a"'s only match 1's in f2 so they do not get flagged
>>"b"'s match a 2 and a 3 so it gets flagged
>>"c" only matches a 4 however 4's match "c" and "d" so it gets flagged
>>etc etc
>>
>>hope that explains it better, as I said I'm not looking for a solution to the above, I already have that, it's just what I was doing when I found that an update fails doing the same query where a select is sucessfull, that's what puzzles me.
>
>What is your SELECT which worked?

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)
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform