LoginSignup
2
3

More than 5 years have passed since last update.

PostgreSQLで連続した3文字のアルファベットの一覧を作成する方法

Last updated at Posted at 2015-09-04
SELECT
  string_agg(chr(num), '') OVER (ROWS BETWEEN 0 PRECEDING AND 2 FOLLOWING) 
FROM generate_series(65, 90) num
LIMIT 24;

 string_agg 
------------
 ABC
 BCD
 CDE
 DEF
 EFG
 FGH
 GHI
 HIJ
 IJK
 JKL
 KLM
 LMN
 MNO
 NOP
 OPQ
 PQR
 QRS
 RST
 STU
 TUV
 UVW
 VWX
 WXY
 XYZ
(24 rows)
2
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
3