postgre drop table whose name like "test%" 根据表名 模糊删除 上面这种话sql你知道怎么写么?
postgre drop table whose name like "test%" 根据表名 模糊删除 上面这种话sql你知道怎么写么?
不支持 DROP
时模糊匹配。
你只能先查出来所有表名,然后挨个删除了。
SELECT DISTINCT(table_name) FROM information_schema.columns WHERE table_name LIKE 'test%';
也可以用 FOR LOOP + END LOOP
直接 SQL 里写循环,就是比较难受……