xml地图|网站地图|网站标签 [设为首页] [加入收藏]

join关联查询

来源:http://www.ccidsi.com 作者:呼叫中心培训课程 人气:176 发布时间:2019-07-10
摘要:     $citylist=M('city')-field('cityid,cityname')-where('cityidin '.$subquery)-select();      $list=$model-alias('a')-join(' LEFT JOIN tsh_greenschool bon a.greenschoolid=b.id')     -field('a.*,b.gs_schoolnamecn,b.gs_schoolnameen')

     $citylist=M('city')->field('cityid,cityname')->where('cityid in '.$subquery)->select();

     $list=$model->alias('a')->join(' LEFT JOIN tsh_greenschool b on a.greenschoolid=b.id')

  


     ->field('a.*,b.gs_schoolnamecn,b.gs_schoolnameen')->select();

SELECT DISTINCT gs_provinceid from tsh_greenschool)

 

       dump($temp); 

     $subquery=M('greenschool')->distinct(true)->field('gs_provinceid')->select(false);       $plist=M('province')->field('provinceid,provincename')->where('countryid=1 and provinceid in '.$subquery)->order('provinceid')->select();  

 

  使用thinkphp连贯操作:

SELECT provinceid,provincename from tsh_province where provinceid in(

     dump($temp);

使用sql查询:
SELECT a.*,b.gs_schoolnamecn,b.gs_schoolnameen FROM tsh_greenaction a  LEFT JOIN tsh_greenschool b on a.greenschoolid=b.id 

 

$subquery=M('greenschool')->field('gs_网上皇家赌场网址,cityid')->group('gs_cityid')->select(false);

  }

 $subquery=M('greenschool')->field('gs_provinceid')->group('gs_provinceid')->select(false);

本文由68399皇家赌场发布于呼叫中心培训课程,转载请注明出处:join关联查询

关键词: 68399皇家赌场

上一篇:智能表单系列,智能表单

下一篇:没有了

最火资讯