DB2022. 3. 9. 14:00

[목표]  '[코드]품명' 형태의 문자열에서 '코드' 추출하기 

o 예시 데이터
          [SM-G981N]갤럭시 S20
          [SM-G991N]갤럭시 S21
          [SM-S901N]갤럭시 S22

 

[쿼리]

SELECT SUBSTRING(A.PRODUCT FROM '\[(.*?)\]') AS PRODUCT_CODE,       
                 A.PRODUCT
FROM
      ( 
      	SELECT '[SM-G981N]갤럭시 S20' AS PRODUCT
        UNION ALL
      	SELECT '[SM-G991N]갤럭시 S21'
        UNION ALL
        SELECT '[SM-S901N]갤럭시 S22'
      ) A

 

[수행결과]

 

[참고]

https://popsql.com/learn-sql/postgresql/how-to-use-substring-with-regular-expressions-in-postgresql

 

How to Use substring() with Regular Expressions in PostgreSQL - PopSQL

 

popsql.com

 

http://daplus.net/regex-%EB%8C%80%EA%B4%84%ED%98%B8-%EC%82%AC%EC%9D%B4%EC%97%90%EC%84%9C-%ED%85%8D%EC%8A%A4%ED%8A%B8%EB%A5%BC-%EC%B6%94%EC%B6%9C%ED%95%98%EB%8A%94-%EC%A0%95%EA%B7%9C%EC%8B%9D/

 

[regex] 대괄호 사이에서 텍스트를 추출하는 정규식 - 리뷰나라

간단한 정규식 질문. 다음 형식의 문자열이 있습니다. this is a [sample] string with [some] special words. [another one] 대괄호 안의 단어를 추출하는 정규식은 무엇입니까? sample some another one 참고 : 사용 사례

daplus.net

 

https://namu.wiki/w/%EC%82%BC%EC%84%B1%20%EA%B0%A4%EB%9F%AD%EC%8B%9C/%EC%A0%9C%ED%92%88%20%EB%AA%A9%EB%A1%9D#s-1.1

 

Posted by 이야봉
Env2022. 3. 9. 13:15
[Env] 무료 PostgreSQL 호스팅 서비스 - ElephantSQL

 

[서비스명]

ElephantSQL

https://www.elephantsql.com/

 

 

[사용방법]

1. 회원가입(Github 또는 Google 계정으로도 가능)

2. Team 생성

3. 약관동의

4. Instance 추가(생성)

 

5. 접속정보 확인

 

6. 접속정보 세팅

 

 

https://www.elephantsql.com/

 

ElephantSQL - PostgreSQL as a Service

Security is something we prioritize above anything else. A well built environment start with high coding standards that guard against attempted security breaches. Our system components undergo tests and source code reviews to assess the security before we

www.elephantsql.com

 

Posted by 이야봉
DB2020. 6. 20. 16:42

 

PostgreSQL 샘플 DB 얻는 곳

https://github.com/morenoh149/postgresDBSamples

 

 

대용량 db

https://futurists.tistory.com/19

 

 

Posted by 이야봉