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
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e4492a-44ac9.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e4492a-44ac9.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?