---
title: "一个奇怪的现象"
author: "icyheart"
date: "2009-08-07T17:58:59Z"
tags: ["Oracle", "SQL", "SQL Server"]
slug: "untitled"
draft: false
lastmod: "2009-08-07T17:58:59Z"
id: 442535
url: "https://sucre.iteye.com/blog/442535"
---

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

在sql server中：

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

 

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

但是，在oracle中：

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

 

这个返回值为no

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

 

这个返回值为OK

这种现象该怎么解释呢？