Skip to content

sql error 1241 operand should contain 1 column #7245

@anheicang

Description

@anheicang

Describe the bug:
Query error, error info is sql error 1241 operand should contain 1 column
Version : 19.13.3.26

create table xjy_mysql_inventory_apply
(
    apply_id      Int64,
    campus_id     Int32,
    apply_user_id Int32,
    apply_type    Int8,
    apply_status  Int8,
    create_time   DateTime
)
    engine = MySQL();

error sql :

select apply_id
                 from xjy_mysql_inventory_apply
                 where apply_type = 2
                   and create_time > addDays(now(),-7)
                   and apply_status in (3,4)

but i changed addDays(now(),-7) to '2019-09-01 00:00:00', it works fine.

select apply_id
                 from xjy_mysql_inventory_apply
                 where apply_type = 2
                   and create_time > '2019-09-01 00:00:00'
                   and apply_status in (3,4)

Expected behavior
Both SQL should run OK

Metadata

Metadata

Labels

bugConfirmed user-visible misbehaviour in official release

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions