Cute Happy Ghost
본문 바로가기
728x90
SMALL

DB/Postgresql22

통계 최종쿼리 select * from (select /* business.usr.sub.lifewtrcy.dao.LifewtRcyDAO.selectRcyRecord */ tfi.fclt_sn , tra.fclt_sn , tra.fclt_nm , TO_CHAR(tra.reg_date, 'yyyy-mm-dd')AS "reg_date" , tra.fclt_year || '.' || tra.fclt_mthAS "yearMth" , tcc.comm_nmAS "sgg_nm" , a.comm_nm AS "pr_mthd_dp1" , b.comm_nm as "pr_mthd_dp2" , tra.sgg_cdAs "sggCd" , max(case when tra.sts_wst_type_cd = 'RCY0501' then tra.tot_a.. 2021. 11. 11.
코드 매핑작업; a_code에 해당하는 b_code를 매핑테이블을 활용해 넣어주기 코드테이블 CREATE TABLE public.t_comm_cd ( comm_code varchar(20) NOT NULL, category varchar(20) NULL, comm_nm varchar(200) NULL, use bool NULL, p_code varchar(20) NULL, reg_date timestamp(6) NULL, upd_date timestamp(6) NULL, eng_nm varchar(20) NULL, sort_ordr int4 NULL, CONSTRAINT t_comm_cd_pk PRIMARY KEY (comm_code), CONSTRAINT t_comm_cd_fk1 FOREIGN KEY (category) REFERENCES public.t_category_cd(ctg.. 2021. 11. 10.
[Postgresql] 외부접속 허용하기, unable to connect to server 오류해결하기 경로는 C:\Program Files\PostgreSQL\12\data 이 안에 있는 pg_hba_conf, postgresql.conf파일을 수정 pg_hba_conf파일 IPv4 local connections 하단에 추가하기 host all all 0.0.0.0/0 md5 postgresql.conf파일 listen_addresses = "*" posrt = 5432​ 2021. 7. 27.
[postgresql] 문자형을 정수형으로 컬럼변경에러, you might need to specift USING...String to integer integer형인 컬럼을 character varying로 변경을 했다 table명 : project 컬럼명 : time ALTER TABLE project ALTER COLUMN time TYPE character varying; 이건 수월하게 완료가 됐다 근데 반대로 문자형을 integer형으로 변환하려고 똑같이 썼는데 에러가 나는거다 ALTER TABLE project ALTER COLUMN time TYPE integer; ERROR: column "time" cannot be cast automatically to type integer HINT: You might need to specify "USING time::integer". 정말 알다가도 모를 콤퓨타의 세계 텍스트에서 정수형으로 자동변.. 2021. 7. 15.
728x90
LIST