finereport的SQL编辑器功能很弱,明明在Navicate中能通过的,但在 finereport中却经常报错,又不知道是哪里出了问题,有什么好的语句调试办法吗?
比如下面这段MYSQL代码就属于这种情况:
SELECT card_id,CAST(SUBSTRING(card_id,7,8) AS DATETIME) AS bir,
FROM_UNIXTIME(UNIX_TIMESTAMP(CAST(SUBSTRING(card_id,7,8) AS DATETIME)),'%m-%d') AS TIME,
IF(LEFT(SUBSTRING(card_id,17),1)%2=1,"男","女") AS sex
FROM card
/*
sql语句
DROP TABLE IF EXISTS `card`;
CREATE TABLE `card` (
`id` int(14) NOT NULL AUTO_INCREMENT,
`card_id` varchar(18) DEFAULT NULL,
`name` varchar(20) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
/*Data for the table `card` */
/*
insert into `card`(`id`,`card_id`,`name`) values (1,'52040219770325X064','李四');
*/