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

DB47

[postgresql] null 체크하는 방법, null 데이터 문자열로 치환 - COALESCE 함수 SELECT bacteria , virus FROM data_table ; data_table에서 값을 표출하고싶은데 null값이 들어가니까 화면에 undefined로 떴다 이건 막아야해...! java단에서 처리해주려고 했는데 null값이라서 그런지 아예 list에 키값도 뜨지 않았다... 그래서 쿼리에서 null값처리할 수 있는 방법이 있을까 찾아봤는데 역시나! 방법은 있었다 SELECT , COALESCE(bacteria, '-99') as "bacteria" , COALESCE(virus , '-99') as "virus" FROM data_table COALESCE( 칼럼명 , 바꿀데이터)를 사용해주면 됨 2022. 5. 24.
vscode로 ERD 만들기, ERD Editor , erd 무료 툴 추천 https://marketplace.visualstudio.com/items?itemName=dineug.vuerd-vscode ERD Editor - Visual Studio Marketplace Extension for Visual Studio Code - ERD Editor vscode extension marketplace.visualstudio.com ERD툴에 도무지 정착을 못하는 나... 매번 프로젝트할 때마다 ERD툴 찾아다니는 나.. VScode에 이런 플러그인이 있는지는 몰랐지!!!! 저거 해서 install받으면 됨. 확장자는 {어쩌구}.vuerd.json 로 파일을 생성하면 된다. 이렇게 Open ERD Editor로 연다 테이블 생성 마우스 오른쪽 클릭해서 new table 클릭 .. 2022. 3. 31.
POSTGRESQL 테이블명세서 테이블정의서 추출 쿼리 SELECT info. TABLE_NAME, info. COLUMN_NAME, info.udt_name as type, case when info.character_maximum_length is null then info.numeric_precision else info.character_maximum_length end as length, info.column_default, info.is_nullable, comm.column_comment as comment, case when pri_key.column_name is null then '' else 'PK' end as PK FROM information_schema. COLUMNS info LEFT JOIN ( SELECT PS.schemana.. 2021. 12. 21.
해당문자열 다른문자열로 치환 update문 tableA에서 ㈜ < 특수문자들을 (주) 2021. 12. 16.
728x90
LIST