select page_name, post_message, post_picture FROM tbl_page INNER JOIN tbl_post ON tbl_page.page_id = tbl_post.post_page WHERE DATE(post_feed_time) = DATE(NOW()) AND page_category = 2 and post_message != '' ORDER BY post_like_count DESC LIMIT 0,15
select page_name, post_message, post_picture FROM tbl_page INNER JOIN tbl_post ON tbl_page.page_id = tbl_post.post_page WHERE DATE(post_feed_time) = DATE(NOW()) AND page_category = 3 and post_message != '' ORDER BY post_like_count DESC LIMIT 0,15
select * FROM tbl_page,tbl_post
WHERE tbl_page.page_id = tbl_post.post_page
AND DATE(post_feed_time) = CUR_DATE() AND page_category = 2 AND post_message > ''
วิธีที่ 2 Code (SQL)
SELECT *
FROM (
select * from tbl_page where .......
) tb1
inner join (
select * from tbl_post where .......
) tb2
on tb1.page_id = tb2.post_page