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

syntax error in insert statement with operator #25583

Open
Nike-YunQi opened this issue Apr 29, 2024 · 1 comment
Open

syntax error in insert statement with operator #25583

Nike-YunQi opened this issue Apr 29, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@Nike-YunQi
Copy link

tdengine 版本:3.2.3

问题1:
insert 语句中now + 0b 会语法异常,now + 1b 执行正常,now + 0u 或者 now + 0a 都执行正常

image

异常语句:
`insert into

        td_jd_record_device_event_Device_0_OrgCode_0_EventCode_0 USING
        td_jd_record_device_event TAGS('Device_0', 'OrgCode_0', 'EventCode_0')
        VALUES (now + 0b, 'DeviceInfoName_0', 'DeviceType_0', 'OrgName_0', 'EventId_0',
        '2023-04-11 09:00:00.0', 'EventType_0', 'EventTitle_0', 'EventInfo_0', 1,
        '2023-04-11 10:00:00.0', '2023-04-11 15:00:00.0', 'DealByName_0', 'DealType_0', 'DealOpinion_0',
        0, now, now);`

建表语句:
CREATE STABLE td_jd_record_device_event ( ts TIMESTAMP, device_info_name VARCHAR(64), device_type VARCHAR(32), org_name VARCHAR(64), event_id VARCHAR(32), event_time TIMESTAMP, event_type VARCHAR(32), event_title VARCHAR(32), event_info VARCHAR(256), event_process_state INT, report_time TIMESTAMP, deal_time TIMESTAMP, deal_by_name VARCHAR(32), deal_type VARCHAR(32), deal_opinion VARCHAR(256), send_state INT, create_time TIMESTAMP, modify_time TIMESTAMP ) TAGS ( device_code VARCHAR(32), org_code VARCHAR(32), event_code VARCHAR(32) )

@Nike-YunQi Nike-YunQi added the bug Something isn't working label Apr 29, 2024
@Nike-YunQi
Copy link
Author

问题2:
insert now 执行其他运算符语法异常,如乘法,除法,取余运算等 ;
ps : 加减法运算正常

image

异常语句1:
`insert into

        td_jd_record_device_event_Device_0_OrgCode_0_EventCode_0 USING
        td_jd_record_device_event TAGS('Device_0', 'OrgCode_0', 'EventCode_0')
        VALUES (now * 1, 'DeviceInfoName_0', 'DeviceType_0', 'OrgName_0', 'EventId_0',
        '2023-04-11 09:00:00.0', 'EventType_0', 'EventTitle_0', 'EventInfo_0', 1,
        '2023-04-11 10:00:00.0', '2023-04-11 15:00:00.0', 'DealByName_0', 'DealType_0', 'DealOpinion_0',
        0, now, now);`

image

异常语句2:
`insert into

        td_jd_record_device_event_Device_0_OrgCode_0_EventCode_0 USING
        td_jd_record_device_event TAGS('Device_0', 'OrgCode_0', 'EventCode_0')
        VALUES (now - 1b, 'DeviceInfoName_0', 'DeviceType_0', 'OrgName_0', 'EventId_0',
        '2023-04-11 09:00:00.0', 'EventType_0', 'EventTitle_0', 'EventInfo_0', 1 * 1,
        '2023-04-11 10:00:00.0', '2023-04-11 15:00:00.0', 'DealByName_0', 'DealType_0', 'DealOpinion_0',
        0, now, now);

`

@danielclow danielclow changed the title insert 运算符语法异常 syntax error in insert statement with operator May 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant