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 ))*

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

 

반응형
반응형

'ETC' 카테고리의 다른 글

[AWS] Install AWS SDK on Mac M2 Pro  (0) 2023.12.28
[AWS] Create Access Key  (0) 2023.12.28
[ETC] Paypal 개인결제 링크 만들기  (0) 2021.09.28
[ETC] VisualStudio Error  (0) 2020.04.16
[ETC] File Signatures  (0) 2017.10.12
반응형

'ETC' 카테고리의 다른 글

[AWS] Create Access Key  (0) 2023.12.28
[ETC] Virtual Location  (0) 2021.10.06
[ETC] VisualStudio Error  (0) 2020.04.16
[ETC] File Signatures  (0) 2017.10.12
[ETC] YouTube image Size  (0) 2016.04.06

+ Recent posts