Oracle TO_CHAR Function

แชร์
ฝัง
  • เผยแพร่เมื่อ 5 ก.พ. 2025

ความคิดเห็น • 17

  • @Lifeofrandomness
    @Lifeofrandomness ปีที่แล้ว

    Thank you.

  • @endone3661
    @endone3661 4 ปีที่แล้ว +1

    At 3:12 -> June 16, 2018 but the video was June 15, 2018. Why ?

    • @DatabaseStar
      @DatabaseStar  4 ปีที่แล้ว +1

      Good pickup! I'm guessing it's to do with the timezone. I'm based in Australia which is UTC + 11, so perhaps I recorded and uploaded it in the morning but TH-cam may be based on US time or UTC which could be the day before.

  • @jaydeepadhikari
    @jaydeepadhikari 5 ปีที่แล้ว +1

    Why for example only the number 9 works? I tried using other numbers such as 88888.8 and it didn't work. Please explain.

    • @DatabaseStar
      @DatabaseStar  5 ปีที่แล้ว +3

      It's because the number 9 is used by Oracle to represent any kind of number. It doesn't actually show the number 9, it's just used as an indication. Hope that makes sense.

    • @jdew1996
      @jdew1996 4 ปีที่แล้ว

      SAME lol

  • @rakhshandamujib2793
    @rakhshandamujib2793 6 ปีที่แล้ว +1

    Can you please make a video on how to take an input from the user in the runtime using Oracle Live?

  • @jdew1996
    @jdew1996 4 ปีที่แล้ว

    If I run SELECT TO_CHAR(12345.6789, '99999.9') I get the same result of 12345.7
    What is the logic of keeping the .7?

    • @DatabaseStar
      @DatabaseStar  4 ปีที่แล้ว +2

      The .7 is kept because the format mask you supplied (which is the 99999.9) specifies that you want to show one decimal place. The number displayed is .7 because the original number of .6789 is rounded to one decimal place, so .67 is rounded to .7.

  • @MrCoxreels
    @MrCoxreels 6 ปีที่แล้ว

    thanks bud. helping me cram for m cosc304

    • @DatabaseStar
      @DatabaseStar  6 ปีที่แล้ว

      No problem, happy to help!

  • @saikiranpandilla6329
    @saikiranpandilla6329 2 ปีที่แล้ว

    hi sir,
    1)select to_char('12/06/2022','dd/mm/yy') from dual;
    2)select to_char(sysdate,'dd/mm/yy') from dual;
    why 2nd one is working while first one is not working?

    • @DatabaseStar
      @DatabaseStar  2 ปีที่แล้ว

      I think it’s because the first parameter needs to be a date in a specific format if you enter it inside quotes. And I think the default format is DD-MON-RR so your input should be 12-JUN-22.