Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
私はテーブルを持っています:
Id Code Name 1 001 Marry
この結果が欲しい:
{1,001,Marry}
配列コンストラクターを使用します。
SELECT ARRAY[Id::text, Code::text, Name::text] AS my_arr FROM tbl;
もちろん、共通の型が必要です。配列要素は同じ型でなければなりません。すべての型を にキャストできるtextため、ここでは当然の選択です。
text