常见达梦数据库操作

发布时间:
更新时间:
🕒 阅读时间:1 min read 👀 阅读量:Loading...

查看表结构

select
distinct
utc.COLUMN_ID 排序,
ucc.comments as 中文名,
utc.column_name as 字段名,
concat(utc.data_type,'(',utc.data_length, ')') as 类型,
'否' as 主键,
'否' as 外键,
'' as 备注
from user_tab_columns utc,user_col_comments ucc
where utc.column_name = ucc.column_name and utc.Table_Name = ucc.Table_Name
AND utc.TABLE_NAME='PORTAL_FUNCTIONAL_PERMISSIONS' -- 表明
AND ucc.owner='PORTAL' -- 模式SCHEMA名
order by utc.COLUMN_ID

常用函数

-- 1. 时间格式化 时间戳-》YYYY-MM-DD形式
FROM_UNIXTIME(create_time/1000,'YYYY-MM-DD hh:mm:ss')
-- 2. json类型字段查询
JSON_VALUE(jsonparam, '$.key') -- value为非数组情况
JSON_VALUE(jsonparam, '$.key[0]') -- value为数组的情况下
select lower(rawtohex(sys_guid())) -- id生成

常见达梦数据库操作

作者: Mindspark

本文链接: https://oxai.net.cn/posts/0f205a00

本文采用 知识共享署名-非商业性使用-相同方式共享 4.0 国际许可协议 进行许可。

留言评论

2000年1月1日星期六
00:00:00