본문 바로가기

DB/PostgreSQL

[PostgreSQL] postgreSQL 문자열 합치기

변경 전

> select to_char(now(), 'YYYY-MM-DD') as today

-----------------------------------------------------------

today

2019-05-29

 

변경 후

> select to_char(now(), 'YYYY-MM-DD' || ' 입니다') as today

-----------------------------------------------------------

today

2019-05-292019-05-29 입니다

 

 

|| 를 사용해서연결

 

 

 

SELECT
A.aprv_id ||'(' || B.position || ')' as id_position
FROM 
sct_aprv_route A 
LEFT JOIN 
sct_user B on A.aprv_id = B.uid

----------------------------------------

결과값

아이디(포지션)

 

 

'DB > PostgreSQL' 카테고리의 다른 글

Postgresql 시퀀스  (0) 2020.10.30
PostgreSQL  (0) 2020.04.15
[postgreSql] 테이블명, 컬럼명 대소문자 구분  (0) 2019.08.06
[PostgreSQL] 종열을 횡열으로 바꾸기  (0) 2019.07.17