Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL question
Message
De
07/08/2009 02:49:04
Lutz Scheffler
Lutz Scheffler Software Ingenieurbüro
Dresden, Allemagne
 
 
À
06/08/2009 04:29:53
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Versions des environnements
Visual FoxPro:
VFP 9 SP2
Database:
Visual FoxPro
Divers
Thread ID:
01416401
Message ID:
01416682
Vues:
58
Hi Grgory, Naomi, Walter

I've read the whole tread and give a single answer.

To the first, thank you for your work.
Folks, there is no need to argue about the question I placed, it's not that urgent that you can not wait for me to express myself better.

Noami, I have expressed myself wrong. I agree that one could have read my question the way you have done.

For a given c3 there should be a single combination, I.E in the target of my import C1+C2+C3 could be a candidate key.
I have to figure out every combination C3 that will not fullfill this.

So from
CREATE CURSOR Schnaps (c1 c(1), c2 c(1), c3c(1), i1 I)

INSERT INTO Schnaps VALUES ('A', 'a', '1',01)
INSERT INTO Schnaps VALUES ('A', 'b', '2',02)
INSERT INTO Schnaps VALUES ('A', 'b', '3',03)
INSERT INTO Schnaps VALUES ('A', 'b', '3',04)
INSERT INTO Schnaps VALUES ('B', 'd', '4',05) &&
INSERT INTO Schnaps VALUES ('B', 'd', '4',06) &&
INSERT INTO Schnaps VALUES ('B', 'c', '4',07) &&
INSERT INTO Schnaps VALUES ('B', 'c', '4',10) &&
INSERT INTO Schnaps VALUES ('B', 'c', '4',11) &&
INSERT INTO Schnaps VALUES ('A', 'a', '4',08) &&
INSERT INTO Schnaps VALUES ('A', 'b', '3',09)
I need the records with i1 in (5,6,7,8,10,11)

Your solution will return only i1=8 but in this case it will mix up my target with duplicate definitions.

If I add record
INSERT INTO Schnaps VALUES ('A', 'a', '4',12) &&
your code will not even notice me.

Anyway I found your code a great peace of work. One could try to modify it to figure out all with occurence less then maximal.
(for 4 "A,a" 1 occurence "B,d" 2 and "B,c" 3 times,) so we trace out "A,a" and"B,d".
But the import has the simple rule - just one definition. If I found more then one I create protocoll and keep the first occurence, whatever this means.

So this thread is about the protocoll.

Gregory, Walter

your solutions both create the correct dataset. I have no idea wich one might be faster or better. Anyway both teach me something about SQL SELECT.

Agnes
Words are given to man to enable him to conceal his true feelings.
Charles Maurice de Talleyrand-Périgord

Weeks of programming can save you hours of planning.

Off

There is no place like [::1]
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform