Re: Trimming strings in SQL
Posted in 1998
On Sat, 31 Oct 1998 11:55:34 Olcay Sarioglu wrote:
>
>select length(" abc ")
>from dual
>
>returns 4, not 6. Why?
Again, if you had looked up the length function in TFM you would know.
>>>The LENGTH Function
>>>The LENGTH function returns the number of bytes in
>>>a character column, not including any trailing
>>>spaces. With TEXT or BYTE columns, the LENGTH
>>>function returns the full number of bytes in the
>>>column, including trailing spaces.
>>>
>>>The following example illustrates the use of the
>>>LENGTH function:
>>>SELECT customer_num, LENGTH(fname) + LENGTH(lname),
>>>LENGTH('How many bytes is this?')
>>>FROM customer WHERE LENGTH(company) > 10
:-)
Tony
---
--
The opinions expressed here are mine and only mine.
Best if taken with salt.
Work related replies: asalerno@informix.com
Home related replies: asalerno@monmouth.com
ICQ: http://wwp.mirabilis.com/1406681
-----== Sent via Deja News, The Discussion Network ==-----
http://www.dejanews.com/ Easy access to 50,000+ discussion forums