Querying 2 Tables in a single query

后端 未结 3 1565
梦如初夏
梦如初夏 2020-12-21 16:02

I have a table for posts and a table for categories, what i want is to select posts that are in a specific category. The problem is that the category is stored in another ta

3条回答
  •  心在旅途
    2020-12-21 16:10

    select p.* 
    from posts p 
    inner join categories c 
           on p.id = c.postid 
    where 
         c.category = 'politic'
    

提交回复
热议问题