달력

11

« 2024/11 »

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
2011. 4. 20. 15:12

줄->열 변환 Work/PostgreSQL2011. 4. 20. 15:12

Postgresql 의 특성 중 하나가 배열처리인 것 같다.
아래처럼 경악스러운 기능이 있다.
-----------------------------------------
-bash-3.2$ psql
비밀번호:
Welcome to psql 8.1.22 (server 9.0.3), the PostgreSQL interactive terminal.
 
Type:  \copyright for distribution terms
       \h for help with SQL commands
       \? for help with psql commands
       \g or terminate with semicolon to execute query
       \q to quit
 
WARNING:  You are connected to a server with major version 9.0,
but your psql client is major version 8.1.  Some backslash commands,
such as \d, might not work properly.
 
postgres=#
postgres=#
postgres=# select unnest(string_to_array('111,222,333,444,555', ','));
 unnest
--------
 111
 222
 333
 444
 555
(5건 있음)
postgres=#
-----------------------------------------

이렇게 놀라운 기능이란... 0_0
:
Posted by Elick