Welcome to WebmasterWorld Guest from 54.167.216.239

Forum Moderators: open

MySql Unknown Error

     
2:48 pm on Oct 12, 2017 (gmt 0)

New User

joined:Oct 12, 2017
posts: 2
votes: 0


Hello team, I have this query, but it returns me the following error, what can it be? . regards
SELECT

(
SUM(CASE WHEN ((transaction_type = "USER" or transaction_type = "APP" or transaction_type = "PHONE" or (transaction_type = "USER" and (merchant = "" or merchant = "LD"))) and type = 1 and result = "APPROVAL" and creation_date > '2017-04-12 00:00:00' and creation_date < '2017-10-12 00:00:00') THEN 1 ELSE 0 END) LD,
SUM(CASE WHEN ((transaction_type = "TOP" or transaction_type = "APP" or transaction_type = "CELL") and type = 1 and result = "APPROVAL" and creation_date > '2017-04-12 00:00:00' and creation_date < '2017-10-12 00:00:00') THEN 1 ELSE 0 END) TOPUP


)

from table
[Err] 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'LD,
SUM(CASE WHEN ((transaction_type = "TOPUP" or transaction_type' at line 4
4:00 pm on Oct 12, 2017 (gmt 0)

Senior Member

WebmasterWorld Senior Member topr8 is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Apr 19, 2002
posts:3377
votes: 41


i think you might need to use END CASE; rather than just END
that's a start anyway, i think it will probably give you a different error after that
6:58 pm on Oct 12, 2017 (gmt 0)

New User

joined:Oct 12, 2017
posts: 2
votes: 0


Thank you, the mistake was ( )
 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members