我有一个表,在这里我需要返回两件东西(最好有一个查询):2) otherfield = "-“作为唯一ID的行数。这意味着,如果同一天输入的id是值的两倍--”在otherfield中,我希望将其计数为1。(DISTINCT `id`) AS id, SUM(IF(otherfield = '-', 1,0)) AS `undeclared` FROM mytable GROUP BY date
但这是其他字
Transactions.idPortfolio=1在这里,如果Transactions.Transaction_Amount >0,那么我需要在“添加”列中显示这个值,在“变现”列中显示其他值。但是,我的代码正在生成错误,如下所示。#1064 - You have an error in your SQL syntax; check the manual that c