Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Group by type
Message
 
 
To
30/08/2006 08:02:42
Aaron K. Y. Chu
Health & Care Co. Ltd.
Hong Kong, Hong Kong
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Miscellaneous
Thread ID:
01149718
Message ID:
01149729
Views:
6
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--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform