Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: How to determine the length of the biggest varchar2 column in a table?
On Wed, 15 Jan 1997 00:53:57 GMT, max_at_virtualf.com (Maxwell MacLeod) wrote:
>does anyone know how to do this? For example, if I had a field "name",
>which is varchar2(2000). One value is "Max" and another "Jeromino", I
>need to know the length of Jeromino.
This is very simple, although a bit performance draining :-)
SELECT length (name)
FROM <table_name>
WHERE length (name) =
(SELECT max (length (name)) FROM <table_name>);
This will return multiple rows, if two or more strings have the same length. Remember, this is not an efficient query to run.
Jonathan Ingram
Meridian Technology Group
503.639.0816
Received on Thu Jan 16 1997 - 00:00:00 CST
![]() |
![]() |