How to limit results of a LEFT JOIN

后端 未结 4 1968
南旧
南旧 2020-12-17 09:10

Take the case of two tables: tbl_product and tbl_transaction.
tbl_product lists product details including names and ids while

4条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-17 09:51

    Edit:

    If you want to enforce a limit on each product I would separate it into two queries.

    First get a list of 10 products and then run another query for each of those returning the last five transactions.

提交回复
热议问题