查询tablename 数据库中 以"_copy" 结尾的表 select table_name from information_schema.tables where table_schema='tablename' and table_type='base table' and table_name like '%_copy'; information_schema 是MySQL系统自带的数据库,提供了对数据库元数据的访问information_schema.tables 指数据…
--查询tablename 数据库中 以"_copy" 结尾的表 select table_name from information_schema.tables where table_schema='tablename' and table_type='base table' and table_name like '%_copy'; --information_schema 是MySQL系统自带的数据库,提供了对数据库元数据的访问 --information_schema.tab…
Oracle 查询表的索引包含的字段 select a.uniqueness 索引类型,b.index_name 索引名称,b.column_name 字段 from user_indexes a ,user_ind_columns b where a.table_name=b.table_name and a.index_name = b.index_name and a.table_owner=upper('ETL') and a.table_name='HIS_BANKMENTRUST'…
表是否存在: 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 = 'S…
包含LOB类型字段的表往往需要特殊关照,如何快速的获得包含LOB对象的数据库表?使用DBA_LOBS.ALL_LOBS和USER_LOBS视图可以很方便地获得包含BLOB或CLOB字段的表. 简单看一下效果. 1.创建两个包含LOB类型字段的表T1和T2sec@ora10g> create table t1 (a clob); Table created. sec@ora10g> create table t2 (a blob); Table created. 2.使用USER_LOBS视图查…
select [name] from [TPMS_PRD].[dbo].sysobjects where id in(select id from [TPMS_PRD].[dbo].syscolumns Where name='supplierid') 包含SupplierId这个字段的所有表 格式如下: select [name] from [库名].[dbo].sysobjects where id in(select id from [库名].[dbo].syscolumns Where…
select c.name from SYSCOLUMNS as c left join SYSOBJECTS as t on c.id=t.id where c.name like '这里是某个字段%' and t.name='这里是表名'…
select column_name,table_name,data_type ,data_length,data_precision,data_scale from DBA_TAB_COLUMNS where column_name='C_KSBH';…
最近一直用MySQL-Front的导出导出工具完成数据库的备份,确实比较方便快捷. 后来增加了一张表,其中有blob字段,上传几个文件后,发现导出不好用了,进度条长期处于停滞状态. 想想也是,要把blob字段变成二进制码再放到sql文件里太麻烦了,估计MySQL-Front没有为此设计过. 把blob数据删除后,导出导入自如了.…
场景:查询DNMes数据库中所有包含RFID字段的表名 sql语句: select object_name(id) objName,Name as colName from syscolumns where (name like'%此次写需要查询的字段名称%') and id in(select id from sysobjects where xtype='u') order by objname 测试查询sql语句: select object_name(id) objName,Name a…