[advanced search]
NamePros Domain Auction
Live Event This Thursday at 6PM EDT - Prebidding open now
23 members in the live chat room. Join Chat!
Register Rules & FAQ NP$ Store Active Threads Mark Forums Read
Go Back   NamePros.Com > Design and Development > Programming
User Name
Password

Old 06-06-2008, 01:54 AM   · #1
evdoxos
NamePros Member
 
Trader Rating: (0)
Join Date: Mar 2008
Posts: 34
NP$: 0.00 (Donate)
evdoxos is an unknown quantity at this point
Help! MySQL: invalid use of group function

I have problem with the following query:

SELECT product.prod_id, product.title, product.thumb, product.price
FROM product, order_detail
WHERE product.prod_id=order_detail.product_id
GROUP BY order_detail.product_id
ORDER BY SUM(order_detail.quantity);

On my computer (MySQL 5.0.51a) it works fine.

But on my server (MySQL 4.1.22) I get the msg:"invalid use of group function". Only if I remove the "ORDER BY SUM(order_detail.quantity)" it works.

Can you help me?

I fixed it:

SELECT product.prod_id, product.title, product.thumb, product.price, SUM(order_detail.quantity) AS quantity_sum
FROM product, order_detail
WHERE product.prod_id=order_detail.product_id
GROUP BY order_detail.product_id
ORDER BY quantity_sum;


Please register or log-in into NamePros to hide ads

Last edited by evdoxos : 06-06-2008 at 03:46 AM.
evdoxos is offline   Reply With Quote
Reply

NamePros is a revenue sharing forum.

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


Site Sponsors
Buy Flash Arcade Game Script Buy Flash Arcade Game Script Proof is in the Parking
Advertise your business at NamePros
All times are GMT -7. The time now is 08:32 PM.


Powered by: vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 2.4.0