Skip to content

How to convert Statement to Expression #1764

Closed
@kevin2000

Description

@kevin2000

the target sql is "select * from table2 where id in (SELECT id FROM table1 WHERE find_in_set(100, ancestors))"

the follow code will throw exception that Statement cant convert to Expression
InExpression expression = new InExpression();
expression.setLeftExpression(new Column(deptColumn));
Statement subSelect = CCJSqlParserUtil.parse("SELECT id FROM table1 WHERE find_in_set(100, ancestors)");
expression.setRightExpression((Expression) subSelect);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions