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