oracle中dual表的使用
2024-10-18 22:27:20
dual表是一个虚拟表,用来和select语句一起使用。
1、查看当前用户
select user from dual
2、用来调用系统函数
select to_char(sysdate,'yyyy-mm-dd hh24:mi:ss') from dual ----得到当前系统时间
select SYS_CONTEXT('USERENV','TERMINAL') from dual;--获得主机名
select SYS_CONTEXT('USERENV','language') from dual;--获得当前locale
select dbms_random.random from dual;--获得一个随机数
3、得到序列的下一个值或当前值,用下面语句
select your_sequence.nextval from dual;--获得序列your_sequence的下一个值
select your_sequence.currval from dual;--获得序列your_sequence的当前值
4、可以用做计算器
select 7*9 from dual;
5、查空值
select null extattrid,null extattrname from dual union all select extattrid,extattrname from VExtAttrDetail where extattrsn in (22)
最新文章
- mongodb 性能篇
- chrome浏览器开发者工具之同步修改至本地
- OpenCV图像的二值化
- SQLServer 关闭自增长,插入数据
- 移动端 移动web屏幕适配方案 随不同宽度的屏幕而改变
- HW7.1
- XUTils框架的学习(三)
- Python爬虫实战(二)
- 需要考虑的9个SEO实践
- git - 简明指南(转)
- Magento首页显示产品
- python 字符串 string
- ubuntu下python跑任务输出到文件中遇到的一些问题(输出重定向)
- C#获取日期的星期名称
- ajax 200 4 parseerror 的错误
- (Review cs231n)loss function and optimization
- jdk1.8使用的url和driverName的改变
- Vue实例data对象里允许有哪些类型数据
- Lerning Entity Framework 6 ------ Using a commandInterceptor
- Struts2中 radio标签的详细使用方法