I'm getting error #1248 - Every derived table must have its own alias ,
below is the full msql statement please Help Im newbie many thanks.
below is the full msql statement please Help Im newbie many thanks.
Code:
SELECT `Posts`.`Post_id` AS `posts_id`, `Posts`.`title` AS `title`, LEFT(`Posts`.`body`, 512) AS `preview`, `comments`.`total_comments` AS `total_comments`, `category`.`Cat_id` AS `category_id`, `body`,`category`.`Cat_name`, DATE_FORMAT(`comments`.`last_comments`, `%d/%m/%y %H:%i:%s`) AS `last_comments` FROM `Posts` INNER JOIN `category` ON `category`.`Cat_id` = `Posts`.`Cat_id` LEFT JOIN (SELECT `Post_id`, COUNT(`Comm_id`) AS `total_comments`, MAX(`comm_date`) AS `last_comment` FROM `comments`) GROUP BY `comments`.`Post_id` AS `comments`"
Comment