pg数据库字符串切割使用案例
select unnest(string_to_array('1,2,3',','))::int2;
select regexp_split_to_table('1,2,3,4',',')::int2;
使用案例
select 1 from [table] where state in (select regexp_split_to_table(@state_str,',')::int2 )
select unnest(string_to_array('1,2,3',','))::int2;
select regexp_split_to_table('1,2,3,4',',')::int2;
使用案例
select 1 from [table] where state in (select regexp_split_to_table(@state_str,',')::int2 )