试试这个:
BEGIN;-- let's create a temp table to bulk data intocreate temporary table temp_json (values text) on commit drop;copy temp_json from 'C:SAMPLE.JSON';-- uncomment the line above to insert records into your table-- insert into tbl_staging_eventlog1 ("EId", "Category", "Mac", "Path", "ID")select values->>'EId' as EId, values->>'Category' as Category, values->>'Mac' as Mac, values->>'Path' as Path, values->>'ID' as ID from (select json_array_elements(replace(values,'','\')::json) as values from temp_json ) a; COMMIT;
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)