Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

select sql problem

Status
Not open for further replies.

pomodoro

Programmer
Apr 18, 2003
6
IT
Hallo i write the string:

SELECT casban.*,layout.*,;
SUM(casban.entrata1) AS totent1,;
SUM(casban.entrata2) AS totent2,;
SUM(casban.entrata3) AS totent3,;
SUM(casban.entrata4) AS totent4,;
SUM(casban.entrata5) AS totent5,;
SUM(casban.entrata6) AS totent6,;
SUM(casban.entrata7) AS totent7,;
SUM(casban.uscita1) AS totusc1,;
SUM(casban.uscita2) AS totusc2,;
SUM(casban.uscita3) AS totusc3,;
SUM(casban.uscita4) AS totusc4,;
SUM(casban.uscita5) AS totusc5,;
SUM(casban.uscita6) AS totusc6,;
SUM(casban.uscita7) AS totusc7;
FROM casban,layout;
WHERE casban.datareg >= x_dadata .AND. casban.datareg <= x_adata ;
GROUP BY casban.numero ;
ORDER BY casban.datareg ;
INTO CURSOR listamov

Compare an error with SQL:GROUP BY clause is missing or invalid.
i do not understand wath is the problem
thanks
 
>casban.*,layout.*

You can't have all fields and only group by one casban field.

In a select query with groups by fields can only be in one of two categories:
1. the fields you group by
2. aggregate functions, which give a result per group

Bye, Olaf.
 
What Olaf says, or you can SET ENGINEBEHAVIOR 70 understanding that you're running an ambiguous query.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top