Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Rid Duplicates with SQL
Message
De
03/11/2014 17:17:35
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
 
À
03/11/2014 12:46:26
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
OS:
Windows 7
Network:
Windows 2008 Server
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01610363
Message ID:
01610424
Vues:
41
>NO!!!! Setting Enginebehavior to 80 is the same as accepting that you may end up with the wrong data. Not a good solution!

So, in this case, you get a wrong one out of a pair of twins? Not good at all!

IOW, the term "wrong data" is wrong by itself, in the absence of definition of "right data". With enginebehavior 80 or 70, the definition is "values coming from any random record within the group-by", and all the values you may get are valid by that definition. Once you accept that randomness, like we did between FP2.0 - VFP7, you're fine. Or you can decide that you don't care, because the values are irrelevant or also candidates for group-by but not really because they are derived values (because we are perhaps denormalizing for a report, and one of those fields is customer name - where the customer's PK is already in the group-by - so since the name is the same for each record in the group, which of these same values are wrong and which is right?).

This argument that one among the random values may be right while all others are wrong - well, it sounds to me like a theoretical justification for the two random Joe Q Coders who didn't really understand what they were doing, so they got what they were not expecting, and then complained... In the end, the CYA logic led to "it's not deterministic, they guys aren't bozos, we can't have pseudo-random stuff coming out of our queries" (as if the order of records isn't already pseudo-random, and can't be guaranteed unless you specify it). So they straddled everyone with kilometer long group-by clauses just to avoid complaints (and, who knows, perhaps lawsuits), from future generations of Joe Qs.

So perhaps the group-by rules are forcing you to repeat ridiculous amounts of code (and if it's a long case statement you get to repeat that too), but at least it will save you from the perils of getting a random value.

I still liked the old one more.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform