Jump to content


Photo

GROUP BY


  • Please log in to reply
1 reply to this topic

#1 SharkBait

SharkBait
  • Members
  • PipPipPip
  • Advanced Member
  • 845 posts
  • LocationMetro Vancouver, BC

Posted 03 October 2006 - 03:13 PM

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'

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?

#2 thekl0wn

thekl0wn
  • New Members
  • Pip
  • Newbie
  • 5 posts
  • LocationPoCo, IN

Posted 04 October 2006 - 02:12 PM

Any column included in the SELECT, but not in a GROUP BY or an aggregate function ( SUM, etc ), will throw an error.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users