I have a query that grabs details of items that have been ordered from an ecommerce site. Order details are in "tracking" and ordered items in "trackitem".
The query works fine and generates a row for each item, including bits of info retrieved from other tables.
So the next thing I need to do is aggregate rows that are for the same item, at the same price. I've looked at GROUP BY but can't figure out how to get it to group rows with same product name and price, and generate a column with the total of the number of aggregated rows in each row.
Can someone please point me in the right direction?
INNER JOIN `trackitem` ON `trackitem`.`trackitem_tracknum` `tracking`.`tracking_id`
INNER JOIN `product` ON `product`.`product_number` `trackitem`.`trackitem_itemnumber`
INNER JOIN `country` ON `country`.`country_id` `tracking`.`tracking_country`
INNER JOIN `Songs` ON `Songs`.`song_id` `product`.`song_id`
WHERE `tracking`.`tracking_status` 'C' AND `tracking`.`tracking_epoch` > 1287492451 AND `tracking`.`tracking_epoch` < 1304876408 AND ( `country`.`country_id` = '822' OR `country`.`country_id` = '214' )
ORDER BY `trackitem`.`trackitem_itemname`
-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/mysql?unsub=listsearcharchive@lassosoft.com
Search
Lasso Programming
This site manages and broadcasts several email lists pertaining to Lasso Programming and technologies related and used by Lasso developers. Sign up today!