Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Sql group by clause is invalid or missing
Message
From
01/03/2005 05:11:36
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 8 SP1
Miscellaneous
Thread ID:
00991464
Message ID:
00991480
Views:
10
This message has been marked as a message which has helped to the initial question of the thread.
>Hi all,
>
>
>This sql command give " Sql group by is invalid or missing "....
>
>
>
>
> 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;
>    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
>
>
>
>What can i do ?
>
>bernhart

Bernhart,
Instead of a union can't you write it as single SQL using or?
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 or 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
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform