무슨.. 맨날맨날 기절
'개소리 왈왈 > 직딩의 비애' 카테고리의 다른 글
회사 정전으로 인해 (0) | 2019.10.13 |
---|---|
멘탈 와사삭 (4) | 2019.10.11 |
현타 거나하게 오네.. (4) | 2019.09.26 |
체불 퇴직금 신고 (0) | 2019.09.19 |
추석 전날 피곤.. (2) | 2019.09.12 |
무슨.. 맨날맨날 기절
회사 정전으로 인해 (0) | 2019.10.13 |
---|---|
멘탈 와사삭 (4) | 2019.10.11 |
현타 거나하게 오네.. (4) | 2019.09.26 |
체불 퇴직금 신고 (0) | 2019.09.19 |
추석 전날 피곤.. (2) | 2019.09.12 |
array 안에서는 select 문을 통해 다른 값들을 받아 하나의 필드로 출력을 해준다.
개꿀! (unnest로 풀면되지!)
The result I get is:
+-----------------------+
| ?column? |
+-----------------------+
| 15:00:00 Dissertation |
| 17:00:00 Dinner |
| 23:00:00 Sleep |
+-----------------------+
Now that I have my rows, I can turn them into an array. Now, the ARRAY function needs to be invoked via a SELECT. Thus, using ARRAY means that we’re using a subselect. The inner SELECT is what we did above. The outer one is just our call to ARRAY:
SELECT ARRAY(SELECT meeting_at::time || ' ' || description
FROM Appointments
WHERE meeting_at::date = '2014-may-23'
ORDER BY meeting_at);
And sure enough, we get a one-row, one-column result:
+--------------------------------------------------------------+
| array |
+--------------------------------------------------------------+
| {"15:00:00 Dissertation","17:00:00 Dinner","23:00:00 Sleep"} |
+--------------------------------------------------------------+
[링크 : https://lerner.co.il/2014/05/23/turning-postgresql-rows-arrays-array/]
postgresql 데이터베이스 다른 이름으로 복구하기 (0) | 2019.10.07 |
---|---|
postgresql rank() over() (0) | 2019.10.04 |
postgresql LEFT JOIN = LEFT OUTER JOIN (0) | 2019.10.01 |
다른 테이블과 join 하여 update 하기 (0) | 2019.10.01 |
where 조건에 다른 select문 사용하기 - exists (0) | 2019.09.30 |
헐.. INNER , OUTER 보다 보니
LEFT JOIN은 어느걸까 했는데 OUTER일 줄이야..
INNER, OUTER 부터 다시 공부해야겠다. ㅠㅠ
[링크 : http://www.postgresqltutorial.com/postgresql-left-join/]
postgresql rank() over() (0) | 2019.10.04 |
---|---|
여러 줄을 하나의 값으로 합치기 - array() (0) | 2019.10.02 |
다른 테이블과 join 하여 update 하기 (0) | 2019.10.01 |
where 조건에 다른 select문 사용하기 - exists (0) | 2019.09.30 |
postgresql 경고? temporary file leak (0) | 2019.09.30 |
select 문만 쓰다가 update를 join을 통해 하려니 신기한 느낌?
update 문에 table이 하나 있으니 FROM 으로 다른 테이블을 정해주면 자연스럽게(?) join이 된다.
UPDATE tb1 SET col2 = tb2.col22 FROM tb2 WHERE tb1.col1 = tb2.col21 |
여러 줄을 하나의 값으로 합치기 - array() (0) | 2019.10.02 |
---|---|
postgresql LEFT JOIN = LEFT OUTER JOIN (0) | 2019.10.01 |
where 조건에 다른 select문 사용하기 - exists (0) | 2019.09.30 |
postgresql 경고? temporary file leak (0) | 2019.09.30 |
unnest()로 regexp_matches()의 {} 벗기기 (0) | 2019.09.30 |
select로 추려낸 결과를 다른 select - where 문에서 쓰기 위한 방법
[링크 : https://stackoverflow.com/questions/1136380/sql-where-in-clause-multiple-columns]
+
2019.10.04
라는데.. 굳이 이걸 써야 하나 싶긴하네
select * from where (val1_upper, val2_upper) in (select val1,val2 from something)
postgresql LEFT JOIN = LEFT OUTER JOIN (0) | 2019.10.01 |
---|---|
다른 테이블과 join 하여 update 하기 (0) | 2019.10.01 |
postgresql 경고? temporary file leak (0) | 2019.09.30 |
unnest()로 regexp_matches()의 {} 벗기기 (0) | 2019.09.30 |
postgresql 콤마 리스트를 열로 분리하기 - unnest() (0) | 2019.09.29 |
temporary file leak: File 4 still referenced
아.. 먼가 불안한 경고다..
일단 급한건 아니니 나중에 봐야지..
[링크 : https://dba.stackexchange.com/questions/112079/slow-query-performance-due-to-temporary-file]
다른 테이블과 join 하여 update 하기 (0) | 2019.10.01 |
---|---|
where 조건에 다른 select문 사용하기 - exists (0) | 2019.09.30 |
unnest()로 regexp_matches()의 {} 벗기기 (0) | 2019.09.30 |
postgresql 콤마 리스트를 열로 분리하기 - unnest() (0) | 2019.09.29 |
postgresql where similar to (정규표현식) (0) | 2019.09.29 |
regexp_matches()는 여러개가 매칭될수 있어서 array()로 리턴하는데
{} 로 쌓여 있어서 그걸 벗기기 위해서는 unnest()를 하는게 가장 간단한데..
select 까진 문제없으나..
udpate 시에는 multiple row가 나올 녀석은 아예 배제가 되니 주의
[링크 : https://stackoverflow.com/questions/10593400/remove-braces-from-regular-expression-result]
where 조건에 다른 select문 사용하기 - exists (0) | 2019.09.30 |
---|---|
postgresql 경고? temporary file leak (0) | 2019.09.30 |
postgresql 콤마 리스트를 열로 분리하기 - unnest() (0) | 2019.09.29 |
postgresql where similar to (정규표현식) (0) | 2019.09.29 |
update case (0) | 2019.09.26 |
boolean() 으로 특정 element를 조회하면 될 듯?
[링크 : https://stackoverflow.com/questions/5689966/how-to-check-if-an-element-exists-in-the-xml-using-xpath]
+
2019.12.17
옛날 글이라 그런가 링크가 깨졌네
The boolean function converts its argument to a boolean as follows:
|
[링크 : https://stackoverflow.com/questions/5689966/how-to-check-if-an-element-exists-in-the-xml-using-xpath]
[링크 : http://www.w3.org/TR/xpath/#function-boolean] << 옛날 링크
Rules
The function computes the effective boolean value of a sequence, defined according to the following rules. See also Section 2.4.3 Effective Boolean Value XP31.
|
[링크 : https://www.w3.org/TR/xpath-functions-31/#func-boolean] << 새로운 링크?
XML DOM과 SAX (0) | 2019.12.01 |
---|---|
xpath 복수개의 attribute 동시에 만족하는 항목 찾기 (0) | 2019.09.14 |
xsd minOccurs, maxOccurs (0) | 2019.09.11 |
xpath count() (0) | 2019.09.09 |
xpath xsi (0) | 2019.08.12 |
unnest를 사용하니 ,로 구분된 리스트를 여러개의 열로 나눌수 있었다.
string_to_array()의 반대 개념이라고 하면 되려나?
regexp_split_to_table() 도 사용할 수 있으나 regexp의 cost가 비싼 편이라 추천은 안하는 듯
[링크 : https://stackoverflow.com/questions/29419993/split-column-into-multiple-rows-in-postgres]
[링크 : https://www.postgresql.org/docs/current/functions-string.html#FUNCTIONS-STRING-OTHER]
+
예제에 따라 다르지만 select에서 써도 되고 from에서 lateral join으로 구현해도 되고
어느게 cost가 낮을려나?
[링크 : https://www.postgresql.org/docs/9.2/functions-array.html]
[링크 : https://wwwi.tistory.com/350]
+
postgresql 경고? temporary file leak (0) | 2019.09.30 |
---|---|
unnest()로 regexp_matches()의 {} 벗기기 (0) | 2019.09.30 |
postgresql where similar to (정규표현식) (0) | 2019.09.29 |
update case (0) | 2019.09.26 |
존재하는 테이블에 시퀀스 값 추가하기 (2) | 2019.09.26 |
The operator ~~ is equivalent to LIKE, and ~~* corresponds to ILIKE. There are also !~~ and !~~* operators that represent NOT LIKE and NOT ILIKE, respectively. All of these operators are PostgreSQL-specific. |
[링크 : https://www.postgresql.org/docs/9.3/functions-matching.html]
SQL> select * from test where x ~ '[0-9]+'; -- "~" 는 "similar to" 의미입니다. |
[링크 : https://www.postgresdba.com/bbs/board.php?bo_table=B10&wr_id=44]
unnest()로 regexp_matches()의 {} 벗기기 (0) | 2019.09.30 |
---|---|
postgresql 콤마 리스트를 열로 분리하기 - unnest() (0) | 2019.09.29 |
update case (0) | 2019.09.26 |
존재하는 테이블에 시퀀스 값 추가하기 (2) | 2019.09.26 |
sql group by like? (0) | 2019.09.25 |