知识星球
笔记
榜单
全部
编程开发
芋道快速开发平台 Boot + Cloud
前往星球内
SQL查询问题:自动添加AND e.tenant_id = 1条件
内容概览
我在进行SQL查询时发现,查询总记录数时不会自动添加e.tenant_id = 1,而查询明细时却会自动添加这一条件。这导致了查询结果的不一致。请问,触发自动添加AND e.tenant_id = 1条件的原因是什么?
phoenixy
2024-10-17 15:31
评论1
查询 总记录数select count(1) from iot_device_equip e,iot_device_permission p where e.type is not null and p.project_id = e.tenant_id and (p.device_id is null or p.device_id = e.sn) and length(e.type) = 4 and p.user_id = ? and type = ? and status ...
芋道快速开发平台 Boot + Cloud
星球已运营 4 年零 211 天
累计超过
34000+
位成员加入
6小时前
最近更新
40000+
内容数
进入星球主页