Mysql
 sql >> Database >  >> RDS >> Mysql

Combina due query MySQL SELECT

Puoi JOIN le due tabelle così:

SELECT 
  p.ID, 
  p.post_title,  
  c.cat_nicename, 
  p.post_perma 
FROM       TBL_POSTS p
INNER JOIN TBL_CATEGORIES c 
        ON p.CategoryID = c.Cat_ID
WHERE      p.published = '1' 
  AND      p.page = '0' 
ORDER BY   p.ID ASC 
 LIMIT 50