Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: query to delete last record of a table
cricketunes_at_yahoo.com wrote:
> Awrite my bad. I shud have explained better.
>
> I have this attribute Customer ID as a Primary Key and it goes
> sequentially like C1, C2, C3.....
>
> I want a query like this:
> Delete from Customer where CustID = 'C'+'select count(*) from
> Customer';
>
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> What is the correct expression for the underlined part of the query
> string?
>
> Thanks :)
Delete from customer where custid =
(select 'C'||max(to_number(substr(custid,2))) from customer);
Received on Mon Apr 18 2005 - 09:33:54 CDT