locked
need help in oracle slip function RRS feed

  • Question

  • User1248258412 posted

    Hi, my data have amount like below with decimal and string behind.

    May I know how to only display amount and only showing 2 decimal?

    '123.10001 ABC'  -- how to display only 123.10

    '1892.81 ASS' -- how to diaply only 1892.81

    Wednesday, March 1, 2017 8:54 AM

Answers

  • User269602965 posted

    SELECT TRUNC(TO_NUMBER(SUBSTR(MYSTRING,1,INSTR(MYSTRING,' ',1,1))),2) AS DISPLAY_NUMBER FROM MYTABLE;

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, March 2, 2017 2:18 AM