This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Oracle/OAS and the fly likes Fetching Max value from NVARCHAR column Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Products » Oracle/OAS
Bookmark "Fetching Max value from NVARCHAR column" Watch "Fetching Max value from NVARCHAR column" New topic
Author

Fetching Max value from NVARCHAR column

Neelima Mohan
Greenhorn

Joined: May 23, 2010
Posts: 27
Hi,

How do I fetch the Max value of the data stored in a NVARCHAR column. Presently only numbers are stored in this column.
Max(AliasID) is not returning me the collect value.
Is there a way to fetch these numberic values from NVARCHAR col?
Now don't ask me why it was implemented that way...its an already existing system.

Thanks,
Neelima
Agador Paloi
Ranch Hand

Joined: Jan 24, 2006
Posts: 118
You seem certain that they are all numbers in the column. You can use to_number() function
to convert to numbers and get the max .

If by chance one is not a number , it will throw an invalid number error.

You might consider writing a small function to convert to a number and if it is
invalid number return a null or 0 ?

good luck,
Agad
 
wood burning stoves
 
subject: Fetching Max value from NVARCHAR column
 
Similar Threads
Retrieving data from cachedRowSet
Hibernate; error executing stored procedure
need Urgent help
getString, nulls, and try
ntext problem