A query sql, let's see how to write it.

For the items of

o2o, the table is as follows:
Store shop id name
Commodity goods id name cat_id shop_id price
Category cat id name
search: query the goods that meet the criteria according to the category, list the store, and list the product data. If more than one piece of data in this store meets the criteria, list the item with the lowest price
such as looking for cat_id = 5. How to write this sql?
result field: shop_id shop_name goods_id goods_name cat_id

Mar.19,2021
Menu