TP3.2 join查询加where条件
2018-02-08 14:06
337 查看
用join的时候如果有where,需要把where的判断字段加上表名的,是带前缀的表名!
$data['tp_one.dell'] = "0";
$array['newslist'] = $News->where($data)->join('tp_two ON tp_one.catid = tp_two.id')->select();
$data['tp_one.dell'] = "0";
$array['newslist'] = $News->where($data)->join('tp_two ON tp_one.catid = tp_two.id')->select();
相关文章推荐
- SQL 查询条件放在LEFT OUTER JOIN 的ON语句后与放在WHERE中的区别
- SQL 查询条件放在LEFT OUTER JOIN 的ON语句后与放在WHERE中的区别
- mysql中left join on后面and和where条件查询的差异
- 数据库左连接left join、右连接right join、内连接inner join on 及 where条件查询的区别
- sql查询调优之where条件排序字段以及limit使用索引的奥秘
- Ruby on Rails,使用where方法对持久化对象进行条件查询
- SQL 两表关联查询 where 条件中等号两端字段顺序对效率的影响
- Sql Server where case 满足条件执行 不满足 不做任何条件查询
- 步步为营VS 2008 + .NET 3.5(5) - LINQ查询操作符之Select、Where、OrderBy、OrderByDescending、GroupBy、Join、GroupJoin及其对应的查询语法
- 在 SQL Server 2K 中实现 大小写敏感的查询条件(WHERE ...),类似 Access(VB) 的 StrComp 函数
- iBatis动态条件查询 where的if条件不执行
- tp框架where条件查询数据库
- SQL查询效率where语句条件
- [SqlServer] 性能优化实战-join与where条件执行顺序
- left join on和where 限制查询的区别在于
- MyBatis的Where条件查询
- LINQ 多条件查询 where 条件组建
- Yii2.0中文开发向导——查询条件Where全解析
- 要提高SQL查询效率where语句条件的先后次序应如何写
- left join on 和where条件的放置