You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
WITH selectTemp AS (
SELECT
TOP 100
PERCENT ROW_NUMBER() OVER (ORDER BYCURRENT_TIMESTAMP) as __row_number__,
t.OrgIDAS orgId
FROM
M0Org t
UNION ALLSELECTt.OrgIDAS orgId
FROM
M0Dept t
)
SELECT*FROM selectTemp WHERE __row_number__ BETWEEN 1AND10000ORDER BY __row_number__
Union的第一个表为什么会生成Top 100,然后row_number生成的为位置也不对
Union之后获取Count,生成的语句也不对
Java代码如下:
MPJLambdaWrapper<M0Org> mpjLambdaWrapper = newMPJLambdaWrapper<M0Org>(M0Org.class)
.eq(!StringUtil.isNullOrEmpty(dataGroupOrgId), M0Org::getDataGroupOrgID, dataGroupOrgId)
.unionAll(M0Dept.class, union -> union
.eq(!StringUtil.isNullOrEmpty(dataGroupOrgId), M0Dept::getDataGroupOrgID, dataGroupOrgId)
);
longcount=mpjLambdaWrapper.count();
生成的Sql语句如下:
SELECTCOUNT( * ) FROM M0Org t
获取count(*)的时候,生成的语句没有union all的表
The text was updated successfully, but these errors were encountered:
当前使用版本(必填,否则不予处理)
该问题是如何引起的?(确定最新版也有问题再提!!!)
Union all分页查询生成的语句不正确,SqlServer数据库
重现步骤(如果有就写完整)
Java代码如下:
生成的Sql语句如下:
Union的第一个表为什么会生成Top 100,然后row_number生成的为位置也不对
Union之后获取Count,生成的语句也不对
Java代码如下:
生成的Sql语句如下:
获取count(*)的时候,生成的语句没有union all的表
The text was updated successfully, but these errors were encountered: