解决方案 »

  1.   

    order by 
    case ifnull(b.pric,0)>0 then b.pric
    case ifnull(b._pric,0)>0 then b._pric
    case ifnull(b.shop.pric,0)>0 then b.shop.pric
    case ifnull(c.sele_pric,0)>0 then c.sele_pric end
      

  2.   

    少了when
    order by 
     case when ifnull(b.pric,0)>0 then b.pric
     case when ifnull(b._pric,0)>0 then b._pric
     case when ifnull(b.shop.pric,0)>0 then b.shop.pric
     case when ifnull(c.sele_pric,0)>0 then c.sele_pric end
      

  3.   

    order by 
      case 
       when ifnull(b.pric,0)>0 then b.pric
       when ifnull(b._pric,0)>0 then b._pric
       when ifnull(b.shop.pric,0)>0 then b.shop.pric
       when ifnull(c.sele_pric,0)>0 then c.sele_pric end
      

  4.   

    select a.*,b.pric,b._pric,b.shop.pric,c.sele_pric 
    from a LEFT JOIN b on a.id=b.id LEFT JOIN c on b.id=c.id 
    order by COALESCE(b.pric ,b._pric  ,b.shop.pric ,c.sele_pric )