Re: how about fixing some code like this?

Cryp2Nite <[email protected]> 21 Jul 2003 12:51:15 -0000
Newsgroups gmane.comp.web.oscommerce.suggestions
Message-ID <9a5a2b4d9e2665f09e720e1aa6375dfb@osCommerce-Forums>
This message was sent from: Suggestions and Proposals
http://forums.oscommerce.com/viewtopic.php?p=199608#199608
----------------------------------------------------------------

Sound like a fine idea to me.

One question that has bugged me over the past couple of days, maybe you can answer:

[quote="cstsai"][code]
select
	p.products_id,
	p.products_image,
	max(o.date_purchased) max_date_purchased
from
....
group by
	p.products_id
....
[/code]

[/quote]

My understanding is that this is in fact invalid SQL code?
How is your database going to know which one of the p.products_image entries it is going to show, since you are grouping by p.products_id?
How does MySQL deal with, cases like this?


Cheers,
Rob