0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

SQLでの反復出力(postgresSQL)

0
Posted at

image.png

エンジニア騎士とクエリの魔女への私なりの回答です。

image.png

WITH arg AS (
    SELECT 
         @param AS param
) 
, seq AS ( 
    SELECT
          generate_series(1, arg.param ::INTEGER) AS seq 
    FROM
        arg
) 
SELECT
      string_agg('hello world', ',') 
FROM
    seq

※この後、repeat(text,integer)で解決デキたのでは?と思いました

0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?