Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Query gives wrong results
Message
From
01/08/2001 11:53:40
 
 
To
31/07/2001 13:20:48
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00537861
Message ID:
00538347
Views:
9
This reply is to just put the post in a readable format, but there are a couple of comments below.
>SELECT PROJ.user_proj_no,  ;
>            PROJ.sold_by, ;
>            PROJ_SEG.select,   ;
>            SEGMENT.employeur,   ;
>            PROJ_SEG.proj_mgr_no,   ;
>            PROJ.PROJ_NO ;
>            FROM main_one!PROJ ;
>            LEFT OUTER JOIN main_one!PROJ_SEG   ;
>                 ON PROJ.proj_no = PROJ_SEG.proj_no  ;
>            LEFT OUTER JOIN main_one!SEGMENT   ;
>                 ON PROJ.sold_by = SEGMENT.seg_no ;
>            WHERE PROJ_SEG.select = 1   ;
>                 AND PROJ_SEG.proj_mgr_no = 0   ;
>                 AND PROJ.sold_by > 0   ;
>                 AND !ISNULL(PROJ.po_dt)   ;
>                 AND SEGMENT.employeur = 1 ;
>            GROUP BY PROJ.user_proj_no, SEGMENT.employeur ;
>            ORDER BY SEGMENT.employeur, PROJ.user_proj_no
>
>the result gives:
>01081, 14, 1, 1, 0, 5356
>01247, 12, 1, 1, 0, 5585
>
>The tables show:
>01081, 14, 0, 1, 0, 5356 <- field 'select' shows 0
>01247, 12, 1, 1, 435, 5585    <- field proj_mgr_no shows 435
>
>Which means that I should not get any records.
>Any body have an idea? Is the table header corrupt?

Did you first get the query working w/o the GROUP BY clause, to confirm your join is working correctly?

Also, I believe the GROUP BY clause needs to have all non-calculated fields specified.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform