I just can't get this working at all
Code: Select all
$sql = "SELECT product, title, format, version, DATE_FORMAT(release_date,'%d/%m/%Y') as formatted_release_date FROM downloads GROUP BY product ORDER BY release_date desc";
Basically I have 5 columns. Product that contains prod1, prod2, prod3 & prod4. Format is Macintosh or Windows, version is the version number i.e 1.2.1, 2.2.3. Finally there is date, which is the release date of the software.
Now I have data like the below (for test purposes)
Product title format version date
prod1 Product1 Windows 1.1 01/01/04
prod1 Product1 Macintosh 1.1 01/02/04
prod2 Product2 Windows 2.5 10/05/04
prod2 Product2 Macintosh 2.5 10/05/04
prod3 Product3 Macintosh 1.6 02/03/04
prod4 Product4 Windows 2.2 15/03/04
prod1 Product1 Macintosh 1.2 01/07/04
You will notice I have a record at the very end which is a new release for prod1 on the windows platform. The only difference being is the version number.
When I do the above mentioned group by statement I do not get this new release showing.
Please please help me - its not nice seeing a grown man beg....but this has driven me crazy for several days now.
All I want to do is list the latest release of each product (windows & Mac)!
Don't get me started on the DISTINCY keyword, how useless is that if you cannot extract data from the other columns!