Do.

HANA SQL Handbook 본문

SAP/HANA Studio(CDS View,Query)

HANA SQL Handbook

성공보다는 가치를.. 2022. 7. 18. 11:48
728x90

SELECT SESSION_USER "session user" FROM DUMMY;

*--------------------------------------------
*-- Conversion Function 
*--------------------------------------------
SELECT FLOOR (14.5) "floor" FROM DUMMY;

SELECT TO_DECIMAL(7654321.888888, 10, 3) "to decimal"
FROM DUMMY;

*--------------------------------------------
*-- String Function 
*--------------------------------------------
SELECT TRIM ('a' FROM 'aaa123456789aa') "trim both" FROM DUMMY;

SELECT UPPER ('Ant') "uppercase" 
FROM DUMMY;

SELECT CONCAT ('C', 'at') "concat" FROM DUMMY;

SELECT REPLACE ('DOWNGRADE DOWNWARD','DOWN', 'UP') "replace" 
FROM DUMMY;

SELECT RTRIM ('endabAabbabab','ab') "rtrim" FROM DUMMY;

SELECT RIGHT('HI0123456789', 20) "right" FROM DUMMY;

SELECT  WEEK ('2017-01-02') FROM DUMMY;

SELECT LENGTH ('length in char') "length" FROM DUMMY;

SELECT SUBSTRING ('1234567890',4,2) "substring" FROM DUMMY;

*--------------------------------------------
*-- Date Function 
*--------------------------------------------
SELECT CURRENT_DATE "current date" FROM DUMMY;

SELECT 
DAYS_BETWEEN (TO_DATE ('2009-12-05', 'YYYY-MM-DD'),
TO_DATE('2010-01-05', 'YYYY-MM-DD')) "days between" 
FROM DUMMY;

SELECT TO_DATE('2010-01-12', 'YYYY-MM-DD') "to date" 
FROM DUMMY;

SELECT WEEKDAY (TO_DATE ('2010-12-31', 'YYYY-MM-DD')) "week day" 
FROM DUMMY;

SELECT TO_VARCHAR (TO_DATE('2009-12-31'), 'YYYY/MM/DD') "to varchar" 
FROM DUMMY;

SELECT 
YEARS_BETWEEN(TO_DATE('2001-01-01'), 
TO_DATE('2003-03-14')) "years_between" 
FROM DUMMY;

SELECT YEAR (TO_DATE ('2011-05-30', 'YYYY-MM-DD')) "year" 
FROM DUMMY;

SELECT MONTH ('2011-05-30') "month" FROM DUMMY;

SELECT NOW () "now" FROM DUMMY;

SELECT LAST_DAY (TO_DATE('2010-01-04', 'YYYY-MM-DD')) "last day" 
FROM DUMMY;

SELECT DAYOFYEAR ('2021-05-30') "dayofyear" 
FROM DUMMY;

 

출처 : https://help.sap.com/docs/HANA_SERVICE_CF/7c78579ce9b14a669c1f3295b0d8ca16/20a61f29751910149f99f0300dd95cd9.html?locale=en-US

728x90

'SAP > HANA Studio(CDS View,Query)' 카테고리의 다른 글

[PP] AMDP BAdI 구현  (0) 2022.11.22
SQL Statements  (0) 2022.07.01
CDS View가 저장되는 테이블  (0) 2022.06.29