【MySQL】检查表存在

 

    <select id="checkTableExists" resultType="java.util.Map">
        select count(*) as cnt
        from information_schema.tables
        where table_schema = database() and `table_name` = #{tableName}
    </select>

 

posted @ 2023-03-10 16:28  谷粒-笔记  阅读(24)  评论(0)    收藏  举报