'2019/08/26'에 해당되는 글 3건

  1. 2019.08.26 sql select if or case
  2. 2019.08.26 order by group by
  3. 2019.08.26 postgresql 정규 표현식 검색

표준 sql 에서는 if는 존재하지 않고 mysql에서만 전용 명령어로 제공하는 듯

그래서 그 대신에 case - when - then - end 구조로 처리하게 된다.

 

[링크 : https://devbox.tistory.com/entry/DBMS-CASEWHENTHEN]

 

CASE WHEN condition THEN result
     [WHEN ...]
     [ELSE result]
END

[링크 : https://www.postgresql.org/docs/9.1/functions-conditional.html]

 

 

'프로그램 사용 > postgreSQL' 카테고리의 다른 글

join  (0) 2019.08.27
postgresql ROW_COUNT  (0) 2019.08.27
order by group by  (0) 2019.08.26
postgresql 정규 표현식 검색  (0) 2019.08.26
sql ||과 concat()  (0) 2019.08.22
Posted by 구차니

order by로 할 걸 group by로 하는걸 고민하고 있었나..

그러니 안되지.. ㅠㅠ

 

[링크 : https://mingggu.tistory.com/83]

[링크 : https://gangnam-americano.tistory.com/25]

[링크 : https://www.popit.kr/마케터를-위한-sql-3-group-by-살펴보기/]

 

 

 

 

 

 

 

'프로그램 사용 > postgreSQL' 카테고리의 다른 글

postgresql ROW_COUNT  (0) 2019.08.27
sql select if or case  (0) 2019.08.26
postgresql 정규 표현식 검색  (0) 2019.08.26
sql ||과 concat()  (0) 2019.08.22
pgadmin 에서 table 생성 SQL문 얻기  (0) 2019.08.20
Posted by 구차니

 

 

-- Gets zero or any spaces numbers and text characters before one R
SELECT * FROM table WHERE column ~ '^[\s\w]*[R]{1}$'

-- Gets zero or any spaces numbers and text characters after one R
SELECT * FROM table WHERE column ~ '^[R]{1}[\s\w]*$'

[링크 : https://stackoverflow.com/questions/46978821/postgres-regex-begins-with-and-ends-with]

'프로그램 사용 > postgreSQL' 카테고리의 다른 글

sql select if or case  (0) 2019.08.26
order by group by  (0) 2019.08.26
sql ||과 concat()  (0) 2019.08.22
pgadmin 에서 table 생성 SQL문 얻기  (0) 2019.08.20
sql substring  (0) 2019.08.16
Posted by 구차니