Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: SQL query for finding values that are not contained in a table
dimitris_at_cs.umb.edu wrote:
> Thanks Jens, It actually works. Nice trick :)
> I wished that sql treated expression lists
> like subqueries in order to make queries
> like this simpler.
>
> E.g if we could say something like
>
> select * from ('a1', 'a2', ....)
> MINUS
> select col1 from tab1
>
> D.
This could be a possiblity:
select col1
from
(select decode(rownum, 1, 'a01',2, 'a02',3, 'a03',4, 'a04',5, 'a05',6,
'a06',7, 'a07',8, 'a08',9, 'a09',10, 'a10',11, 'a11',12, 'a12',13, 'a13',14, 'a14',15, 'a
It isn't pretty, but it does work:
SQL> select * From listtest;
COL1
7 rows selected.
SQL> set echo on SQL> @tabtest SQL> select col1
'a05',6, 'a06 ',7, 'a07',8, 'a08',9, 'a09',10, 'a10',11, 'a11',12, 'a12',13, 'a13',14, 'a14',1
COL1
11 rows selected.
SQL> David Fitzjarrell Received on Thu Oct 20 2005 - 15:34:46 CDT
![]() |
![]() |