Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
VFP8 GROUP BY Restriction
Message
 
 
À
28/05/2003 09:12:46
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00793077
Message ID:
00793455
Vues:
24
Hi Chaim,

It's not clear from your post what 'query fails' means. Do you get an error, incorrect result, something else?

SELECT DISTINCT compares all the fields in the list. In case SELECT DISTINCT iemppk,sortname,clocation if any of fields 'iemppk,sortname or clocation' is different than it's different row.

>Hi Sergey,
>At first, it looked like DISTINCT was working but on the second attempt to use it, it failed. I don't know if the problem is in my understanding or if I have uncovered an anomoly. Here is code which demonstrates the problem:
>* this query fails--it gets distinct rows by empPK and location
>SELECT DISTINCT iemppk,sortname,clocation;
>  FROM cureport1;
>  ORDER BY sortname;
>  INTO CURSOR Cu1
>
>
>* this query fails--it gets distinct rows by empPK and location
>SELECT DISTINCT iemppk,sortname,iDivPK;
>  FROM cureport1;
>  ORDER BY sortname;
>  INTO CURSOR Cu2
>
>* this query succeeds--it gets distinct rows by empPK only
>SELECT DISTINCT iemppk,sortname;
>  FROM cureport1;
>  ORDER BY sortname;
>  INTO CURSOR Cu3
>Any idea what causes query 1 and 2 to fail?
>If you want, I can email you the input data. It is small.
>Thanks, Chaim
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform