模糊查找db2数据库中的数据库表: select tabname,remarks from syscat.tables where TABNAME like 'DM%' select 'DROP TABLE DW_RPT.'||tabname||';' from syscat.tables where tabschema = CURRENT SCHEMA ----------------------------------------------------------------------
T1 表 SEQ表 想得到结果集为: 语句: SELECT * FROM (SELECT * FROM seq,t1) u LEFT JOIN t1 ON u.id=t1.id AND u.jjh=t1.jjh AND u.num >= t1.begin_num AND u.num <= t1.end_num WHERE t1.id IS NOT NULL 说明: seq,t1为表集相乘,行列相乘. seq,所有行对应 t1,每一行,一共对应t1表的行数那么多次 这样相乘后的表集为:
PostgreSQL数据库中获取表主键名称 一.如下表示,要获取teacher表的主键信息: select pg_constraint.conname as pk_name,pg_attribute.attname as colname,pg_type.typname as typename from pg_constraint inner join pg_class on pg_constraint.conrelid = pg_class.oid inner join pg_attribute
自己写代码生成器之生成Dal层代码(获取数据库所有表名称) --得到数据库birthday所有表名称 select name from sysobjects where [type]='U' --select [TABLE_NAME] from INFORMATION_SCHEMA.TABLES where [TABLE_TYPE]='BASE TABLE' --获取列信息,不获取数据 select top 0 * from userInfo 思路:拼接字符串 /// <summary> /
方法一: 现在的导出还是有缺陷的,导出的文件中还是存在其他不必要的信息 #!/bin/bash ##获取数据库 databases=$(hive -e "show databases; exit;") for database in $databases; do #获取hive建表语句 tables=$(hive -e "use $database; show tables;") for table in $tables; do echo "--=====