会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
Nice感觉
海绵不断的吸收
博客园
首页
新随笔
联系
订阅
管理
简单SQL在ORACLE中写法
简单SQL语句ORACLE写法
--
1 SQL语句中去掉字段内容两边的空格。
rtrim
(
ltrim
(
'
demo
'
))
--
截去字符串前的某个字符
ltrim
(
'
1112121
'
,
'
1
'
)
--
显示:2121
--
-----------
--
ORACLE中:
select
trim(
'
df df
'
)
from
dual;
--
2 SQL SERVER中截取字段内容内容:
SUBSTRING
( fieldname,
1
,
2
)
--
-----------
--
ORACLE中函数名是:
substr( fieldname,
1
,
2
)
--
3 SQL SERVER中比较日期:
select
*
from
table
where
fieldname
>
'
2005-01-01
'
--
ORACLE中fieldname是date类型的话:
select
*
from
table
where
fieldname
>
date
'
2005-01-01
'
--
或者:
select
*
from
table
where
fieldname
>
to_date(
'
2005-01-01
'
,
'
yyyy-mm-dd
'
)
posted on
2006-04-18 14:17
Gary.han
阅读(
288
) 评论(
0
)
收藏
举报
刷新页面
返回顶部