急!SQL高手请进:通过查询组合字符串的问题!表t 有三个字符串型字段 YYYY,MM,DD.分别代表年、月、日用什么SQL查询一下,把把三个字段组合成日期后显示的值相加后显示?
要求
如:
YYYY MM DD
2004
2005 12 7
2008 8
查询后显示:2004.7
2005.12.7
2008.8谢谢!
要求
如:
YYYY MM DD
2004
2005 12 7
2008 8
查询后显示:2004.7
2005.12.7
2008.8谢谢!
解决方案 »
- 求助,ICSharpCode.SharpZipLib.Zip 如何进行分段压缩.
- linq多表分组查询
- sql server 中的nchar在c#中应怎么写
- 今天编一个关于加密算法的程序中出现了问题
- 【用户登陆】C#写的用户登录窗体(与数据库连接),谁帮我看看出什么问题了
- 急急急!!注册表问题~
- 如何继承控件,在线等,马上结贴
- 帮忙看看这个:must be assigned to before control leaves the current method
- 在c#开发的网站中,网站banner需要根据登陆者的所在的地区,显示不同的文字,banner是flash做的
- winform上位机界面,设备分组问题,求思路
- 下面异常是什么原因?
- vs2005中文版不能自动生成dll文件吗?
select
(case when to_char(t.YYYY)<>'' or to_char(t.YYYY) is not null then
(case when to_char(t.MM)<>'' or to_char(t.MM) is not null then
(
case when to_char(t.DD)<>'' or to_char(t.DD) is not null then
concat(concat(to_char(t.YYYY),'.'),concat(concat(to_char(t.MM),'.'),to_char(t.DD)))
else
concat(concat(to_char(t.YYYY),'.'),to_char(t.MM)) end
)
else to_char(t.YYYY) end)
else to_char(t.YYYY) end ) as 日期
from t谢谢各位。