'영어로쓰기힘들어'에 해당되는 글 1건

  1. 2021.10.12 [Oracle] How to easily create a calendar query.

There is a code snippet in the query that I don't understand, but i write them down. ^^;

SELECT TO_CHAR(TO_DATE(ROWNUM+2454832, 'J'), 'YYYYMMDD') AAA
FROM (
    SELECT LEVEL M FROM DUAL
    CONNECT BY LEVEL <= 2556
)
ORDER BY AAA

Result :

 

DateFormat 'J' Option is

Julian day; the number of days since January 1, 4712 BC. Number specified with J must be integers.

https://docs.oracle.com/cd/B19306_01/server.102/b14200/sql_elements004.htm#i34924

 

Format Models

The total length of a datetime format model cannot exceed 22 characters. The default datetime formats are specified either explicitly with the initialization parameter NLS_DATE_FORMAT or implicitly with the initialization parameter NLS_TERRITORY. You can c

docs.oracle.com

 

What is the principle of this snippet?

SELECT LEVEL M FROM DUAL
CONNECT BY LEVEL <= 2556


I can guess why, but I don't understand the principle.

Is there anyone who can teach me? ^^;

 

There is a saying in Korea.

If you don't understand, calm down and read(memorize) it.

^^;

 

be the happy Gosu.

woojja ))*

\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

 

반응형
LIST
Posted by woojja

댓글을 달아 주세요

이전버튼 1 이전버튼
반응형