LoginSignup
0
0

More than 1 year has passed since last update.

SQLでの反復出力(postgresSQL)

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