How to add two values

How to add varchar values in oracle. Consider that both are times values.but [both] data type is varchar and stroed table

For example:

Column1 Column2
2.40: 10 05:22

I need the result to the following format
8.02 [8 hours and 2 minutes]

user12059276 wrote:
How to convert this format

Assuming that the result is less than 24 hours:

select to_char(trunc(sysdate) + interval '2:40:10' hour to second + interval '5:22:00' hour to second,'HH24:MI') dt
  from dual
/

DT
-----
08:02

SQL> 

SY.

Tags: Database

Similar Questions

  • How to add two lines when the second row is not visible, but also gets the first data line too?

    Mr President

    Jdev worm is 12.2.1

    How to add two lines when the second row is not visible, but also gets the first data line too?

    I want to add two lines like below picture, but want the second to remain invisible.

    tworows.png

    I asked this question but my way of asking was wrong, that's why for me once again.

    Concerning

    Try to follow these steps:

    1. in the database table to add the new column "JOIN_COLUMN" and add the new sequence "JOIN_SEQ".

    2. Add this new column in the entity object. (You can add this in entity object by right clicking on the entity object and then select "Synchronize with database" then the new column and press on sync)

    3. in your bookmark create button to create only one line NOT 2 rows.

    4 - Open the object entity--> java--> java class--> on the entity object class generate and Tick tick on the accessors and methods of data manipulation

    5 - Open the generated class to EntityImpl and go to the doDML method and write this code

      protected void doDML(int operation, TransactionEvent e)
      {
        if(operation == DML_INSERT)
        {
          SequenceImpl seq = new SequenceImpl("JOIN_SEQ", getDBTransaction());
          oracle.jbo.domain.Number seqValue = seq.getSequenceNumber();
          setJoinColumn(seqValue);
          insertSecondRowInDatabase(getAttribute1(), getAttribute2(), getAttribute3(), getJoinColumn());
        }
    
        if(operation == DML_UPDATE)
        {
          updateSecondRowInDatabase(getAttribute1(), getAttribute2(), getAttribute3(), getJoinColumn());
        }
    
        super.doDML(operation, e);
      }
    
      private void insertSecondRowInDatabase(Object value1, Object value2, Object value3, Object joinColumn)
      {
        PreparedStatement stat = null;
        try
        {
          String sql = "Insert into table_name (COLUMN_1,COLUMN_2,COLUMN_3,JOIN_COLUMN, HIDDEN_COLUMN) values ('" + value1 + "','" + value2 + "','" + value3 + "','" + joinColumn + "', 1)";
          stat = getDBTransaction().createPreparedStatement(sql, 1);
          stat.executeUpdate();
        }
        catch (Exception e)
        {
          e.printStackTrace();
        }
        finally
        {
          try
          {
            stat.close();
          }
          catch (Exception e)
          {
            e.printStackTrace();
          }
        }
      }
    
      private void updateSecondRowInDatabase(Object value1, Object value2, Object value3, Object joinColumn)
      {
        PreparedStatement stat = null;
        try
        {
          String sql = "update table_name set column_1='" + value1 + "', column_2='" + value2 + "', column_3='" + value3 + "' where JOIN_COLUMN='" + joinColumn + "'";
          stat = getDBTransaction().createPreparedStatement(sql, 1);
          stat.executeUpdate();
        }
        catch (Exception e)
        {
          e.printStackTrace();
        }
        finally
        {
          try
          {
            stat.close();
          }
          catch (Exception e)
          {
            e.printStackTrace();
          }
        }
      }
    
  • How to add two time values in oracle

    Hi, I have two time as parameters: pSTTIME and: pETTIME is defined as a VARCHAR2 column type

    I have values for: pSTTIME as 09:00 and: like 15:30 pETTIME

    How to add these two times, I tried with TO_TIMESTAMP and TO_CHAR, I tried also with SUM but he failed in all situations

    can anyone help

    Hello

    TO_NUMBER allows to convert numbers that you can add these channels.
    Use TO_CHAR convert that number into a string.

    In PL/SQL:

    minutes := ( ( TO_NUMBER (SUBSTR (:psttime, 1, 2))
              + TO_NUMBER (SUBSTR (:pettime, 1, 2))
              )
            * 60
            ) + TO_NUMBER (SUBSTR (:psttime, 4, 2)
              + TO_NUMBER (SUBSTR (:pettime, 4, 2);
    str := TO_CHAR (TRUNC (minutes / 60))
        || ':'
        || TO_CHAR ( MOD (minutes, 60)
                       , 'fm00'
                );
    

    In SQL, calculate the NUMBER minutes in a subquery, so you can use the alias in a Super application.

    This assumes that: psttime and: pettime are always well trained: 2 digits for the hours, a colon, then 2 digits for the minutes. If you are unsure of the number of digits, the same basic app will work, but the SUBSTRs will be a little more complicated.

    I hope that answers your question.
    If this isn't the case, after a complete test script that people can run to recreate the problem and test their ideas. Include the VARIABLE, CREATE TABLE, INSERT, or any statement is necessary to provide some examples of data and also after the output you want from this sample data.

  • How to add two columns in the criteria (OBIEE 11 g)

    Hello

    I try to add two columns in a criterion of obiee

    * "Done - OLB processed invoices. "" Invoice amount - currency "__" made - OLB processed invoices "." " The amount of taxes AR - billing currency"

    but the problem is:-
    The first column have 500000000 and the second column contains some NULL values from the table. I think that this could be the problem when I try to add that it gives no output.
    just an empty box.

    Can someone tell me how we can add columns in this State.

    Thank you to each and every one.

    Try IFNULL (expr, value)
    for the other columns

    "Done - OLB processed invoices". " Charge the amount - currency "+ IFNULL (" made - OLB processed invoices "". ")" AR tax - currency billing", 0)

    Published by: Srini VIEREN on March 20, 2013 10:02

  • How to add two controls on the same form datagrid? I get the error message...

    Hello

    I have to add two controls on the same page datagrid. When I try to drag an another DataGrid in the components window, it says "an element with that name already exists in the library."

    How can I add multiple controls on the same page datagrid?

    Kind regards.

    _data2 = new XML (event.target.data2);

    should be

    _data2 = new XML (event.target.data);

    (actually, it's better if it was

    _data2 = XML (event.target.data);

  • How to merge two values of resource bundle?

    Hi all

    JDev worm: 11.1.1.7

    I want to merge two values of resource bundle... How to do?

    like this #{expr? str1: str1 + str2}

    I tried like below and used some features of jstl... but no use did not work... got a parse exception, exception of compilation, etc...

    < af:outputText value = "#{row.accountName eq 'AccountName9'?" {resource ['LBL_WELC']: resources ["LBL_WELC"] + resource ['LBL_HOME']} "/ >"

    I would like to know how to do this?

    Kind regards

    Gopi

    The outputtext above is an example, I can use diff bundle keys like below,

    The principle is the same

    Dario

  • How to swap two values without using the third variable using the procedure

    How to exchange the two values without using the third variable using the procedure?

    In a procedure using two mode we pass two values A = x and B = y, and let us pass parameters to receive the output has A = y and B = x without using the third variable

    Published by: Millar on August 19, 2012 11:23

    Your question doesn't seem wise. As written, there is no reason to a third variable, just

    CREATE OR REPLACE PROCEDURE(
      x IN number,
      y IN number,
      a OUT number,
      b OUT number
    )
    AS
    BEGIN
      a := y;
      b := x;
    END;
    

    If it's an interview question, I suspect that the intention was that you had two settings IN OUT and you wanted to swap the values without the help of a third variable.

    Justin

  • How to return two values of a function?

    Hi all
    I have a function which returns a varchar2 value. This value is used in the SQL of a ref cursor

    Now I want this function returns two values. I tried to use varray, but could not accomplish the task.

    Can you tell me how can I find the two values from a function? and how this function can be called in a SQL query?

    Thank you very much

    The query should look like:

    SELECT v.col.name AS name
         , v.col.flag AS flag
    FROM   ( SELECT kk_test_kk(t.somecolumn,t.someothercolumn,42) AS col
             FROM   sometable t ) v;
    

    Note that you need to prefix with the name of view inline ('v' in the example) and the expression of the function ('col' in the example).

  • How can I add two values together?

    I use the tip action:

    Expression: variable1 = variable1 + '1 '.

    I wish that Captivate to add '1' to the previous value of variable1, not add them.  If variable1 began as 154, after the expression is executed, it must so 1541, not 155.

    Is it possible to add numbers together?

    Thanks for any help!

    Hello

    It seems to work now in HTML5, in fact.

    I use Adobe Captivate 8.

    I have the action advanced (conditional) ' Expression: var1 = var1 + 1 "attached to a click box.  (The condition is simply "1 equals 1".)  I only use conditional statements to ensure that the advanced actions are as flexible as possible.  It was a piece of RodWard. :))) The value of var1 of origin was left white.

    I have a legend of text on the screen with the contents of "$$ var1$".

    It seems to work in HTML5.  The first time I hit the click box, a "1" appears.  Next time, it's '11' and so on.  It does not work as I want only it in swf.  In swf, the first time I hit the click box, a "1" appears. Next time, it is '2 '.

    Either way, I see the same behavior in HTML5 and SWF if I use 1, the number in the expression, or '1', the string.  It seems not to matter.

  • How to add the values of the data from two lines

    We enter the data as

    name values
    ==== ====
    a 100
    b 125
    c 140

    We need output of

    total of the Name values
    ==== ==== ====
    a 100 100
    b 125 225 (100 + 125)
    c 140 365 (225 + 140)

    How do I solve this problem... ?

    1008318 wrote:
    We enter the data as

    name values
    ==== ====
    a 100
    b 125
    c 140

    We need output of

    total of the Name values
    ==== ==== ====
    a 100 100
    b 125 225 (100 + 125)
    c 140 365 (225 + 140)

    How do I solve this problem... ?

    Hello

    SQL> with test_data
      2  as
      3  (
      4  select 'A' name,100 val
      5  from dual
      6  UNION ALL
      7  select 'B',125 from dual
      8  UNION ALL
      9  select 'C',140 from dual
     10  )
     11  select name,val,sum(val) OVER(order by val) total from test_data;
    
    N        VAL      TOTAL
    - ---------- ----------
    A        100        100
    B        125        225
    C        140        365
    

    Kind regards
    Claudy K

    Published by: Claudy K on May 28, 2013 02:52

  • How to add two times together?

    I'm trying to get the result of once added to a time difference to calculate the result. How is that possible?

    Hi SimonJohnD,

    Numbers of tent to make this easy. There may be unexpected results. First of all remember that number once is always associated with a date. So when I type '05:30 ' today the value in the cell is ' 12/01/2016 05:30 '. When I type '2 h' numbers includes it is lasting.

    Looking for more than that?

    Quinn

  • How to add two fields and show the result in a third

    All,
    I have 2 InputText field; both are related to the fields of the associated database.

    I want to display the sum of these two fields on a text output.

    I declare the value of the output in this way text link:
    #{sessionScope.PersonalNrBean.summeDB.value + sessionScope.PersonalNrBean.kmGeldMlp.value}

    But I get this error:
    Cannot find resource for bundle java.util.PropertyResourceBundle, key el.convert

    ADF_FACES - 60097:Weitere desKomitees find DEM Fehlerlog einen entry as servers, der mit: ADF_FACES - 60096:Server - Exception while PPR, beginnt #3

    If I declare the value binding to contain the field even two times:
    #{sessionScope.PersonalNrBean.summeDB.value + sessionScope.PersonalNrBean.summeDB.value}
    It works as expected, but it's not really what I need...

    Any ideas?

    Thanks in advance,
    Sergio.

    Edited by: user5414451 the 14.07.2011 02:57

    Try following:

    #{bindings.summeDB.inputValue.value + bindings.kmGeldMlp.inputValue.value}
    

    Jean Lou

  • How to add two fields of a standard page

    Hi experts,

    I have a requirement according to the customer's requirement.

    I'm working on isupplier. in a particular standard page, I need to add 2 fileds that paid is the type of lookup and a field is messagetextinput.please give me the steps how to approach.

    Thanks in advance

    Hello

    1.), you can create this field through customization.

    2.) go to customize the link of the page (top-right)

    3.) click on the full view
    4.), click on create element

    5.), drop-down list, you can create items accordingly.

    This link may be useful

    http://www.semihuslu.com/Tutorial/OA%20Framework_Java.PDF

    thanx
    Pratap

  • How to add a value to a column of a string of pop up

    I am really inexperienced with spreadsheets, but asked me to help create a timesheet for a rotational system.

    I know that the time could be manually entered and calculated in duration but as there are only four options, let's say A, B, C travel and OFF, it would save a lot of time if there is a pop-up menu along side each name and under every day so that when a change is selected, the corresponding hours would be added in the total column.

    I actually created the spreadsheet with context menus as follows:

    08:00 - 15:00

    15:00 - 22:00

    Off

    08:00 - 18:00

    The reason why the 08:00 - 18:00 is in the end, it is a special change that only supervisors do.

    In any case, is there a way that these string values can be converted to hours to a total of column? I tried, very awkwardly, and I can't really follow the logic of the formulas of the numbers so I would be very grateful if someone could help me.

    I've included a selective screenshot in case my description is not very clear; Thank you.

    Hello Alf,

    The key to this is to use a lookup table for the transit time of list (as in your Menus pop up) and the number of normal hours for this position.

    Note this column of the table must match exactly to your Menus pop up (I added spaces on both sides of the hyphen).

    Then another table (hours) to account for the infeed Table and convert shifts in hours.

    Formula in B2 of table of the hours (and fill right and fill down)

    = INDEX (Lookup::$B,MATCH(Input::B2,Lookup::$A,0))

    My cheat for the combination of the INDEX sheet and MATCH:

    = INDEX (column, I want a value returned by,)

    MATCH (the value of my choice,

    Column, I want to search against.

    Enter ""0")).

    Finally, the formula in the column "hours worked" (right part of the input table)

    I2 = SUM (Hours::2:2)

    And fill down.

    Kind regards

    Ian.

    Edit: You can move (copy / paste) the table and the table to another worksheet hours to 'hide '. Ian.

  • How to add two .cod files two ethical single file

    Hi all

    I am new to the blackberry development.

    I develop an inaugural recongnisation application in the use of blackberry

    http://www.iSpeech.org/

    But the problem is that

    1: file iSpeechSDK.cod you have installed everything first and then install your application.cod files.

    I want to merge two different .cod files in to one.

    is an idea for it.

    I'm working on 6. BlackBerry 9800 Simulator.

    Thanks in advance please

    It is not possible.  However, you can install two cod files at the same time by adding the library COD to your ALX file or JAD file.

Maybe you are looking for

  • color compatibility

    Wouldn't be nice if the Apple website would give you a choice of which Apple Watch you bought in order to see how compatible the new bands are? For example, my Apple Watch rose gold. It'll look good with all the new woven bands? Who knows! It would a

  • Can I switch from XP to Vista to extend protection for my PC beyond April?

    Ends support for Windows XP in April 2014.  Is it possible to upgrade my PC from XP to Vista (rather than Windows 7 or 8), in order to extend the life of my machine? I don't think that my PC could not support Windows 7 and in any case, I have to do a

  • Cannot open doc.files on window vista dell inspiron portable computer

    thinl Word has been removed

  • OMSA can not see my MD1000

    It's a house build for a media server, so it is also my first foray in 2012 (essentials) and OMSA server... so I probably did something wrong. I have an MD1000 with 4 drives connected to a sas 4TB sas 6/e card running a parity of storage of ReFS. Eve

  • A WIN7 in virtual XP mode can join a network working group?

    On a network of workstations XP working group and a Win 2000 Server, when I go into virtual XP on a new Win7 Professional workstation, I can not find the server on the network. In fact, I see no other workstations. The Win7 machine is on the network,