Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UNION ALL 导致缺少列 #94

Open
wamdy opened this issue Nov 22, 2023 · 0 comments
Open

UNION ALL 导致缺少列 #94

wamdy opened this issue Nov 22, 2023 · 0 comments

Comments

@wamdy
Copy link

wamdy commented Nov 22, 2023

当前使用版本(必填,否则不予处理)

1.4.7.2

该问题是如何引起的?(确定最新版也有问题再提!!!)

A->B
UNION ALL
A->B
导子后一个查询语句中缺少B表的字段

重现步骤(如果有就写完整)

MPJLambdaWrapper<SAD> wrapper;
    {
        wrapper = new MPJLambdaWrapper<>(SAD.class, "sad")
                .selectAll(SAD.class, "sad")
                .selectAssociation("ad", AD.class, SAD::getAD)
                .rightJoin(AD.class, "ad", AD::getSADId, SAD::getId);
        
    }

    MPJLambdaWrapper<SAD> wrapper1;
    {
        wrapper1 = new MPJLambdaWrapper<>(SAD.class, "sad")
                .selectAll(SAD.class, "sad")
                .selectAssociation("ad", AD.class, SAD::getAD)
                .leftJoin(AD.class, "ad", AD::getId, SAD::getADId);
        
    }
    wrapper1.unionAll(wrapper);

    this.selectJoinListPage(page, SAD.class, wrapper1);

报错信息

bad SQL grammar []; nested exception is java.sql.SQLException: The used SELECT statements have a different number of columns

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant