Search code examples
mysqlposts

Trying to write Mysql query for my database


Here is a image on my database http://oi46.tinypic.com/2eb5lpw.jpg

enter image description here

I wonder if it possible to get posts from "Meals" by restID?


Solution

  • It is easy:

    SELECT m.* 
    FROM meals m JOIN cats c ON m.catId=c.catId 
    WHERE restId='theRestIdIWantToQuery'