源数据如图:使用max语句:selects.os_username,max(decode(s.unix_host,'192.168.0.20',to_char(s.create_date,'yyyy-mm-dd'),'no'))贰零,min(decode(s.unix_host,'192.168.0.23',to...
源数据如图:
使用max语句:
select s.os_username, max(decode(s.unix_host,'192.168.0.20',to_char(s.create_date,'yyyy-mm-dd'),'no')) 贰零, min(decode(s.unix_host,'192.168.0.23',to_char(s.create_date,'yyyy-mm-dd'),'no')) 贰叁, min(decode(s.unix_host,'192.168.0.26',to_char(s.create_date,'yyyy-mm-dd'),'no')) 贰陆from service sgroup by s.os_username;
使用max的结果:
使用min语句:
select s.os_username, min(decode(s.unix_host,'192.168.0.20',to_char(s.create_date,'yyyy-mm-dd'),'no')) 贰零, min(decode(s.unix_host,'192.168.0.23',to_char(s.create_date,'yyyy-mm-dd'),'no')) 贰叁, min(decode(s.unix_host,'192.168.0.26',to_char(s.create_date,'yyyy-mm-dd'),'no')) 贰陆from service sgroup by s.os_username;
使用min的结果:
请问 为什么 在使用 max 时 贰零列 出来的数据是日期的个数 和使用 min 不一样
应该不管用max还是min 出来的‘no’的个数该相同的啊!?
求解……
展开