Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: query to delete last record of a table

Re: query to delete last record of a table

From: DA Morgan <damorgan_at_x.washington.edu>
Date: Sun, 17 Apr 2005 23:05:59 -0700
Message-ID: <1113804134.101808@yasure>


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 :)

You have a poorly designed primary key but given that ... What query will return the highest value?

After you have that ... use it in a subquery.

-- 
Daniel A. Morgan
University of Washington
damorgan_at_x.washington.edu
(replace 'x' with 'u' to respond)
Received on Mon Apr 18 2005 - 01:05:59 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US