简体   繁体   中英

PostgreSQL problems running query

I am having problems with the syntax on the below line. I can't seem to pinpoint what the issue is. I am using PostgreSQL, and am rewriting queries used from MySQL. I keep getting a syntax error.

sum(CASE WHEN(date(a.date_added) between ('{{2018-10-04}}', 
CURRENT_DATE - INTERVAL '14 DAY') and '{{2018-10-04}}',b.quantity,0)) THEN Sales14 END

Any help is appreciated

THEN Sales14 END should be inside the parentheses

sum(CASE WHEN(date(a.date_added) between ('{{2018-10-04}}', 
    CURRENT_DATE - INTERVAL '14 DAY') and '{{2018-10-04}}',b.quantity,0) THEN Sales14 END) 

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM