MySql implements the method of cross table query

  • 2020-05-24 06:21:51
  • OfStack


SELECT c.id, c.order_id, c.title, c.content, c.create_time, o.last_pic FROM `orders` o , `case` c WHERE c.order_id = o.order_id ORDER BY c.id DESC LIMIT 15;

About methods of extracting fields across tables!
Same order_id field is employed to extract the id case, order_id, title, content, create_time; The last_pic field in the orders table

Related articles: