官网文档地址
常用函数
regexp_split_to_table
,regexp_split_to_array
分离字符串为数组或者表字段:SELECT foo FROM regexp_split_to_table('the quick brown fox jumps over the lazy dog', '\s+') AS foo; SELECT regexp_split_to_array('the quick brown fox jumps over the lazy dog', '\s+');
表操作
- 删除多列,并且判断是否有列字段存在:
ALTER TABLE tab DROP COLUMN IF EXISTS col1,DROP COLUMN IF EXISTS col2;
- 同理,删除表,并且判断表是否存在:
DROP TABLE IF EXISTS tab;