Results 1 to 2 of 2

Thread: Total length

  1. #1
    Join Date
    Mar 2006
    Posts
    127

    Total length

    Hi all,

    I have a query that looks like this:

    select length((col1)||') '||upper(col2)||' '||upper(col3)||' '||
    upper(col4)||' '||col5||chr(11))

    FROM table1, table2

    It returns the following results:

    24
    27
    43
    53
    28

    I need to get the total of all these numbers. How can I accomplish that?

  2. #2
    Join Date
    Nov 2002
    Location
    New Jersey, USA
    Posts
    3,932
    How about using SUM()

    select SUM(TO_NUMBER(
    length((col1)||') '||upper(col2)||' '||upper(col3)||' '||
    upper(col4)||' '||col5||chr(11))
    ))
    FROM table1, table2

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •