mysql的函数问题

select namespace, name, version , description from api_registry where namespace = 'alibaba' and name = 'foo2' and version = 10

select namespace, name, max(version) as version , description from api_registry where namespace = 'alibaba' and name = 'foo2' and version = 10
会得到不同的结果
第1条语句是查询不到任何记录,第2条语句是得到一条所有字段都为null的记录,
而第2条语句的情况如果在ibatis中会出现queryForObject查询的结果不是null,而是一个所有属性都为null的对象,当对象中有原生类型的属性,程序就会出错,有空要看看其他数据库是否有这样的问题。

你可能感兴趣的:(MySQL,iBATIS,Mysql)