最近做适配人大金仓的项目中遇到的小问题
sql查询语句报错如下:
原因是因为MySQL中的DATA_FORMAT函数在pgsql中不适配,故换一种表示方法
MySQL 中:
select id,ag_name,DATA_FORMAT(Ag_starttime,'%Y-%m-%d') as Times,DATA_FORMAT(Ag_starttime,'%h:%i') as TimesHour,(case IFNULL(ag_status,'0') when 0 then '未召开' when 1 then '正在召开' when 2 then '已经召开' else '' end) as Status ,ag_congressid as Pid from tagenda.TableName() WHERE ag_congressid = 'entrys["id"].(string)'
PostgreSQL/人大金仓 中:
select id,ag_name,to_char(Ag_starttime,'%Y-%m-%d') as Times,to_char(Ag_starttime,'%h:%i') as TimesHour,(case IFNULL(ag_status,'0') when 0 then '未召开' when 1 then '正在召开' when 2 then '已经召开' else '' end) as Status ,ag_congressid as Pid from tagenda.TableName() WHERE ag_congressid = 'entrys["id"].(string)'