Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Sql group by clause is invalid or missing
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 8 SP1
Miscellaneous
Thread ID:
00991464
Message ID:
00991469
Views:
18
This message has been marked as the solution to the initial question of the thread.
SET ENGINEBEHAVIOR 80

SELECT E.iid                     AS 'iempl' , ;
       NVL( P.iPlanPauseID , 0 ) AS 'plpid' ,;
       SUM( H.n120 + H.n100 )    AS "nsum";
       FROM Employee E;
       INNER JOIN Horaire H  ON  E.iid = H.iemployeeid ;
       INNER JOIN PAUSE P ON P.iid = H.cpauseid  ;
       WHERE MONTH(H.ddate) = 2 AND YEAR(H.ddate) =  2005 AND E.iid = 127;
       GROUP BY 1,2;
UNION;
       SELECT E.iid              AS 'iempl' , ;
       NVL( P.iPlanPauseID , 0 ) AS 'plpid' ,;
       SUM( H.n120 + H.n100 )    AS "nsum";
       FROM Employee E;
       INNER JOIN Horaire H  ON  E.iid = H.iemployeeid ;
       INNER JOIN PAUSE P ON P.iid = H.cpauseid2  ;
       WHERE MONTH(H.ddate) = 2 AND YEAR(H.ddate) = 2005 AND E.iid = 127;
       GROUP BY 1 , 2;
INTO CURSOR Temp
You missed the first SQL GROUP BY clause
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Reply
Map
View

Click here to load this message in the networking platform