Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Group by type
Message
 
 
À
30/08/2006 08:02:42
Aaron K. Y. Chu
Health & Care Co. Ltd.
Hong Kong, Hong Kong
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Divers
Thread ID:
01149718
Message ID:
01149729
Vues:
8
You don't need JOIN. Move all fields into the inner SELECT, group on all of them and get rid of outer select.

>
>However, when I try to join with the field there is a duplicate entries
>
>
>SELECT a.case_no, a.eng_name, a.chi_name, b.cash, b.credit, b.eps from income_log a INNER join ;
>(select case_no, sum(IIF(Paid_Type="V", paid, 0)) as Credit, sum(IIF(Paid_Type="$", paid, 0)) as CASH,
 sum(IIF(Paid_Type="E", paid, 0)) as EPS FROM income_log group by case_no) b ;
>on a.case_no = b.case_no into cursor income_output order by 1
>
>
>What's wrong about it?
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform