I have managed to get the total number of downloads for that category by using this:
Code: Select all
SELECT COUNT(*) AS id FROM downloads WHERE category='Kingmaker';But now, I want to get the last added download, where the category is kingmaker.How could I do this?
The old code I was using was this below:
This worked because all categories were in different tables, but now I have interjoined them I don't know how to do it.
Code: Select all
select * from kingmaker where id = (select max(id) from kingmaker);
Code: Select all
select * from downloads where category = kingmaker AND id = (select max(id));Code: Select all
SELECT * FROM downloads WHERE ID = (SELECT MAX(ID) AND category='kingmaker');