oracle 查看表是否存在、包含某字段的表、表是否包含字段

表是否存在:
  select count(*) from user_tables where table_name = #{tablename}

包含某个字段的表
  select *
    from user_tab_columns
  where UPPER(column_name)='CREATE_TIME'

特定表是否包含字段
  select *
    from user_tab_columns

  where UPPER(column_name)='CREATE_TIME' AND TABLE_NAME = 'SYS_USERLOG'

猜你喜欢

转载自www.cnblogs.com/jyybeam/p/9396026.html