Home » SQL & PL/SQL » SQL & PL/SQL » how to find max if data type is varchar2
how to find max if data type is varchar2 [message #228058] Sat, 31 March 2007 01:54 Go to next message
anitar
Messages: 4
Registered: January 2007
Location: Aurangabad
Junior Member
hi

i have one table with column pf_number of varchar2 datatype
and in this column data gets stored in format MH/32336/126
i want to find max of pf_number i can use hear SUBSTR and to_number function but it returns me only 126
i want advanced SQL function for it which returns me complete
string in format'MH/32336/126

thanks

rgards
anitar
icon14.gif  Re: how to find max if data type is varchar2 [message #228061 is a reply to message #228058] Sat, 31 March 2007 02:13 Go to previous messageGo to next message
narayanan.v
Messages: 29
Registered: September 2005
Junior Member
Hi,

Could give more details on this, with more samples.
Re: how to find max if data type is varchar2 [message #228112 is a reply to message #228058] Sat, 31 March 2007 14:11 Go to previous messageGo to next message
Littlefoot
Messages: 20888
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
MAX works with VARCHAR2 datatype column values as well; why do you think you need a number?

Also, what kind of advanced SQL function are you looking for? What could it do that SUBSTR couldn't?
Re: how to find max if data type is varchar2 [message #228183 is a reply to message #228058] Mon, 02 April 2007 00:43 Go to previous message
Frank
Messages: 7880
Registered: March 2000
Senior Member
MH/32336/126 is NOT a format. It is an example of one of your codes.
Since it does not show us how it can vary, how would you expect us to help you find your 'max' ??
Previous Topic: materialized views
Next Topic: execute procedure in SqlDeveloper which returns recordset
Goto Forum:
  


Current Time: Sat Dec 03 04:11:37 CST 2016

Total time taken to generate the page: 0.10410 seconds