Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Drop unwanted character from query ex.25516 becomes 2551 1

Status
Not open for further replies.

iteach2

Technical User
Sep 16, 2001
120
US
Gurus,

I have a table that stores numbers in the from of 25516 but for purposes of my query I wish to drop the 6 so that it only shows 2551 - how can I format my query to exlude that last number for showing in the query [ponder]
 
Try this:
Code:
Select substr(column_name, 1, length(column_name) - 1)
from   TableName

OR
Code:
Select rtrim(Column_Name, '6')
from   TableName

If the column is int/number then you need to use to_char to convert it to varchar first.

Regards,
AA
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top