我有以下 MySQL 表:
TABLE: Products
----------------------
id | productname
1030 | xBox 360
1031 | PlayStation 3
1032 | iPod Touche
TABLE: Sales
----------------------
productid | saledate
1031 | 2010-06-14 06:30:12
1031 | 2010-06-14 08:54:38
1030 | 2010-06-14 08:58:10
1032 | 2010-06-14 10:12:47
我想使用 php 获取我今天销售的产品,并按销售编号和按销售日期排序(如果可能)对它们进行分组,输出示例:
Today's statistics:
-Playstation 3 (2 sales)
-Xbox 360 (1 sale)
-iPod Touche (1 sale)
谢谢