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: Mon, 18 Apr 2005 09:54:41 -0700
Message-ID: <1113843058.863203@yasure>


cricketunes_at_yahoo.com wrote:

> How can i find the highest value when the available values are C1, C2,
> C3....C10?

Exactly why I said your primary key was a bad design choice.

The best solution would be to fix your primary key.

If you can't do that for some reason then:

SELECT MAX(SUBSTR(<primary_key_column>,2)) FROM <table_name>;

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

Original text of this message

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