문제

I am inserting the array of elements {idno,age,salary} as {1,10000,30} in PostgreSQL database and I need to split and store into the respected columns of the table.

How to store the split array elements in respect columns of table?

First is this possible , if possible can some one explain me ,how can we do it?

도움이 되었습니까?

해결책

Like this?

insert into test(idno, age, salary)
select D[1], D[2], D[3]
from (select '{1,10000,30}'::int[]) as A(D);

sql fiddle demo

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top