B*****g 发帖数: 34098 | 1 简单的SQL都bug无数,是11g烂还是公司DBA烂? | y****w 发帖数: 3747 | 2 不带这么欺负dba的。
【在 B*****g 的大作中提到】 : 简单的SQL都bug无数,是11g烂还是公司DBA烂?
| c*****d 发帖数: 6045 | 3 give us some examples
【在 B*****g 的大作中提到】 : 简单的SQL都bug无数,是11g烂还是公司DBA烂?
| B*****g 发帖数: 34098 | 4 前面recursive和distinct就不提了. 看下面这个:
WITH a AS (
SELECT 1 ID, 'A' VAL FROM DUAL
UNION ALL
SELECT 2, 'A' FROM DUAL),
b AS (
SELECT 2 AS ID FROM DUAL
)
SELECT a.id, b.id
FROM a, b
WHERE a.val LIKE '%A%'
AND a.id = b.id(+);
下面这些都对:
WITH a AS (
SELECT 1 ID, 'A' VAL FROM DUAL
UNION ALL
SELECT 2, 'A' FROM DUAL),
b AS (
SELECT 2 AS ID FROM DUAL
UNION
SELECT 2 AS ID FROM DUAL
)
SELECT a.id, b.id
FROM a, b
WHERE a.val LIKE '%A%'
AND a.id = b.id(+);
WITH a AS (
SELECT 1 ID, 'A' VAL FROM DUAL
UNION ALL
SELECT 2, 'A' FROM DUAL),
b AS (
SELECT 2 AS ID FROM DUAL
)
SELECT a.id, b.id
FROM a, b
WHERE a.val = 'A'
AND a.id = b.id(+);
WITH a AS (
SELECT 1 ID, 'A' VAL FROM DUAL
UNION ALL
SELECT 2, 'A' FROM DUAL),
b AS (
SELECT 2 AS ID FROM DUAL
)
SELECT a.id, b.id
FROM a, b
WHERE REGEXP_LIKE( a.val, 'A')
AND a.id = b.id(+);
【在 c*****d 的大作中提到】 : give us some examples
| b*****r 发帖数: 239 | 5 which version 11.1 or 11.2? | B*****g 发帖数: 34098 | 6 Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit
【在 b*****r 的大作中提到】 : which version 11.1 or 11.2?
|
|