日期和字符串
| mysql | oracle |
|---|---|
| date_format(date,'%Y-%m-%d') | to_char(date,'yyyy-MM-dd') |
| str_to_date(date,'%Y-%m-%d') | to_date(date,'yyyy-MM-dd') |
查询表字段和注释
mysql
select * from information_schema.columns
where table_schema = ‘数据库名称’ and table_name = ‘表名称’;
例:
select * from information_schema.columns
where table_schema = 'testdatabase' and table_name = 'testTable';
oracle
select * from user_col_comments
a where table_name = '表名称'
例:
select column_name,comments from user_col_comments
a where table_name = 'testTable'