【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  翠微  阅读(9)  评论(0编辑  收藏  举报