Re: SELECT 'X'
Date: 14 Aug 2002 20:09:39 +0100
Message-ID: <3d5aaaf3$1_at_news.wineasy.se>
You should go to http://asktom.oracle.com and search for "duplicate rows". You will find many alternative solutions to delete duplicate rows in a table, if that's what you really want to do.
/Per
"Steve" <smontgomerie_at_hotmail.com> wrote in message
news:156709aa.0208140557.2815ff3c_at_posting.google.com...
> tks
>
> here's a better example
>
> delete from my_table t1
> where exists (select 'x' from my_table t2
> where t2.deptno = t1.deptno
> and t2.dname = t1.dname
> and t2.rowid > t1.rowid);
>
> the delete removes duplicates from a table
>
> so in this case is 'X' like a cursor, cheking for all records
> tht meet the criteria and then subsequently passing the records
> to the delete for removal?
>
> steve
>
>
>
> tenmuc_at_onlinehome.de (Michael) wrote in message
news:<e5a603fb.0208140113.421429ed_at_posting.google.com>...
> > Hi Steve,
> >
> > SELECT 'X' FROM emp WHERE empno = 1 does result in ONE record
> > containing 'X' if there is a record in the table emp where empno=1
> > else the result is empty (NULL). SELECT 'X' means the result is ALWAYS
> > 'X'.
> > This Statement will never work.
> > What do you want to do?
> >
> > DELETE FROM EMP WHERE EMPNO=1;
> > It says: All records in the table EMP are deleted in which the clause
> > after "WHERE" is true, in the example all records where empno=1.
> >
> > After "WHERE" is an expression expected, and only those records in the
> > table are deleted, where the clause results in a TRUE.
> >
> >
> > Regards
> > Mike
> >
> > > Hello,
> > > Having developer trying to run something like this
> > >
> > > DELETE FROM EMP
> > > WHERE (SELECT 'X' FROM emp WHERE empno = 1);
> > >
> > > the statement fails with missing expression
> > >
> > > I'm unclear on the usage of SELECT 'X'
> > > an also why does the statement fail?
> > >
> > > tks
> > >
> > > steve
Received on Wed Aug 14 2002 - 21:09:39 CEST