mysql 获取全部表名

获取库db1的全部表名

select table_name from information_schema.TABLES where TABLE_SCHEMA='db1' and TABLE_TYPE = 'base table';

获取path_names_png字段,截去最后一个‘-’及以后的部分

SELECT path_names_png, LEFT(path_names_png, char_length(path_names_png) - LOCATE('_', REVERSE(path_names_png))) from yfyj