1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
| WITH t AS (
SELECT 1 AS id,'id1' AS libelle, NULL AS pere FROM dual union ALL
SELECT 2 ,'id2' , 1 FROM dual union ALL
SELECT 3 ,'id2b' , 1 FROM dual union ALL
SELECT 4 ,'id4' , NULL FROM dual
)
select * from t
where libelle = select libelle from t where libelle = 'id2'
ORA-00936: missing expression
WITH t AS (
SELECT 1 AS id,'id1' AS libelle, NULL AS pere FROM dual union ALL
SELECT 2 ,'id2' , 1 FROM dual union ALL
SELECT 3 ,'id2b' , 1 FROM dual union ALL
SELECT 4 ,'id4' , NULL FROM dual
)
select * from t
where libelle = (select libelle from t where libelle = 'id2') |
Partager