locked
oracle change display field RRS feed

  • Question

  • User1248258412 posted

    i have a fields that keep data like "HelloAll Morning", anyone know when select this field, when detect a space between.. I want the display to become "Morning HelloAll"; exchange place.

    eg: HelloAll Morning --> Morning HelloAll

    John Smith --> Smith John

    Monday, August 5, 2013 10:21 PM

Answers

  • User1293050055 posted

    i don't know Oracl.

    i know sql server

    SELECT
         RIGHT(COLUMN_NAME,
          CHARINDEX(' ',REVERSE(' '+COLUMN_NAME)))+' '
          +LEFT(COLUMN_NAME,  CHARINDEX(' ',COLUMN_NAME))
          AS NAME
         
      FROM TABLE_NAME

    If you will try above query in sql server you will get your output.

    try to convert same query in oracle.i hope you will get your result.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, August 6, 2013 12:37 AM