Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Query without max()
Message
De
15/09/2019 01:19:01
 
 
À
14/09/2019 09:47:26
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
01670845
Message ID:
01670861
Vues:
63
>>
>>Sir I wrote this query by myself
>>
>>SELECT  a.code, a.names, a.country,b.qty 
>>FROM #table1  a, 
>>   (
>>   SELECT code, sum(qty)as qty
>>FROM #table1
>> GROUP BY code
>> ) b
>>WHERE a.code = b.code
>>
>>
>>This display the correct sum of qty but with double row like this
>>
>>1104 ERIC Holland 110
>>1104 ERIC Holland 110
>>1105 Boris Bulgaria 90
>>1105 Boris Bulgaria 90
>>1106 Anil India 100
>>1106 Anil India 100
>>1107 Cetin Turkey 150
>>1107 Cetin Turkey 150
>>
>>It will be great help if you modify this query.
>>
>>Please
>
>If you meant to get this output, then it is a correct way to write it. Another way is:
>
>
>SELECT code, names, country,
>       SUM(qty) OVER (PARTITION BY code) AS qty
>FROM #Table1
>ORDER BY code;
>
Sir your above query shows double result like shown in attachment.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform