Mysql tips feature...

1. mysql GROUP_CONCAT() uses sorting...

SELECT
  shop.id,
  shop.name,
  shop.user_id,
  shop.address,
  shop.map_location,
  shop.lyl,
  shop.introduce,
  -- 0 unclaimed, 1 claimed 
  shop.is_renling,
  GROUP_CONCAT(img_url ORDER  BY sb.sort DESC ) -- write sort here...not at the end

FROM tc_shop shop LEFT JOIN tc_shop_banner sb ON shop.id = sb.shop_id


WHERE shop.id = 31 AND shop.is_shenhe = 1 AND shop.inblack = 0

 

 

 

 

  

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324652058&siteId=291194637