mysql-如何在PostgreSQL中的查询中写SUM(IF(boolean,integer,integer))col_name
我是Postgresql的新手.我想写这样的查询:SELECTSUM(IF(idin(1,2,3,4,5,6),1,0))spl_countfromtabgroupbyid;但这是行不通的.它给出了这样的错误:functionif(boolean,integer,integer)doesnotexist实际上,我已经尝试过在mysql中执行sum(if(boolean,integer,int