Jump to content

Archived

This topic is now archived and is closed to further replies.

SharkBait

GROUP BY

Recommended Posts

[code]
SELECT T0.DocNum, T0.TrnspCode, T2.ItemCode, T2.U_MODELNUM, T2.Quantity, T2.Price, T2.Weight1, T2.Length1, T2.Width1, T2.Height1 FROM OQUT T0 INNER JOIN OCRD T1 ON T0.CardCode = T1.CardCode INNER JOIN QUT1 T2 ON T0.DocEntry = T2.DocEntry INNER JOIN CRD1 T3 ON T1.CardCode = T3.CardCode WHERE T0.DocNum = '1667' AND T3.AdresType = 'S'
[/code]

How do modify the above query to GROUP BY T2.U_MODELNUM ?  I tack on GROUP BY T2.U_MODELNUM at the end of the query and it doesn't allow for it.  Something about agregated functions?

Share this post


Link to post
Share on other sites
Any column included in the SELECT, but not in a GROUP BY or an aggregate function ( SUM, etc ), will throw an error.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.