嗨,我正在尝试将一些 Access SQL 查询转换为 MySQL 查询并让它遇到问题,因为我不确定如何转换其中的一些代码。有人请帮忙。
1.
SELECT Notices.Promoter,
Sum(IIf([Notices].[Notice Type]='GRANT PERMIT' Or [Notices].[Notice Type]='GRANT VARIATION' Or [Notices].[Notice Type]='GRANT PAA',1,0)) AS Granted,
Sum(IIf([Notices].[Notice Type]='REFUSE APPLICATION',1,0)) AS Refused,
Sum(IIf([Notices].[Permit Status]='Deemed',1,0)) AS Deemed
FROM Notices
GROUP BY Notices.Promoter;
2.
SELECT [Notices].Promoter,
Sum(IIf([Notices].[Notice Type]='VARIATION',1,0)) AS Variation,
Sum(IIf([Notices].[Notice Type]='TWO HOURS AFTER',1,0)) AS [Two Hours After],
Sum(IIf([Notices].[Notice Type]='THREE MONTHS',1,0)) AS [Three Months],
Sum(IIf([Notices].[Notice Type]='THREE DAY',1,0)) AS [Three Day],
Sum(IIf([Notices].[Notice Type]='TEN DAY',1,0)) AS [Ten Day]
FROM Notices
GROUP BY [Notices].Promoter;
Access 数据库和 MySQL 数据库的标签相同,我只需要覆盖这两个数据库,以便获得相同的结果。