在sql server和oracle中有这样一个奇怪的现象:

在sql server中:

  1. select case when '1'<>' ' then 'ok' else 'no' end 
  2. select case when '1'<>'' then 'ok' else 'no' end 

这两条语句的返回值都为OK

但是,在oracle中:

  1. select case when '1'<>'' then 'ok' else 'no' end from dual; 

这个返回值为no

  1. select case when '1'<>' ' then 'ok' else 'no' end from dual;