超级SQL——在SQL中累加
此为转贴,但是从连个帖子中收集而来
下面来一起看看论坛里的一个oracle方面的问题:
====================Question
=========================
jmbdat dayt y mon
27-9月-07 2033.2 2007 200709
28-9月-07 2750.28 2007 200709
29-9月-07 2885.68 2007 200709
30-9月-07 2556.68 2007 200709
01-10月-07 2903.04 2007 200710
02-10月-07 1002.96 2007 200710
03-10月-07 1038.24 2007 200710
对上边的表用sql处理下 变成下面的
jmbdat dayt y mon mont
27-9月-07 2033.2 2007 200709 2033.2
28-9月-07 2750.28 2007 200709 4783.28
29-9月-07 2885.68 2007 200709 7669.16
30-9月-07 2556.68 2007 200709 20225.84
01-10月-07 2903.04 2007 200710 2903.04
02-10月-07 1002.96 2007 200710 &
相关文档:
SQL Server 已封鎖元件 'xp_cmdshell' 的 程序 'sys.xp_cmdshell'
之存取,因為此元件已經由此伺服器的安全性組態關閉。系統管理員可以使用 sp_configure 來啟用 'xp_cmdshell'
的使用。如需有關啟用 'xp_cmdshell' 的詳಄ ......
C#中操作Oracle时的SQL语句参数的用法
OracleTransaction myTrans ;
conn.Open();
myTrans =conn.BeginTransaction(IsolationLevel.ReadCommitted) ......
在数据库查询数据时,我们经常使用一些函数,使我们的查询更加方便快捷,下面就把SQL Server中我们常用的几个函数给列举出来,供参考。
1.字符串函数用户控制返回给用户的字符串,这些功能仅用于字符型数据。
2.日期函数用于操作日期值,我们不能直接对日期运用数学函数。
3.数学函数用于对数值进行代数运算。
4.系统函 ......
--创建链接服务器
exec sp_addlinkedserver 'ITSV ', ' ', 'SQLOLEDB ', '远程服务器名或ip地址 '
exec sp_addlinkedsrvlogin 'ITSV ', 'false ',null, '用户名 ', '密码 '
--查询示例
select * from ITSV.数据库名.dbo.表名
--导入示例
select * into 表 from ITSV.数据库名.dbo.表名
--以后不 ......
Select * from t_user_profile where convert ( varchar ( 21 ),regDate, 120 ) like ' 2008-05-07% ' 表名称:t_user_profile 日期字段名称:regDate
Select * from t_user_profile where convert(varchar(21),regDate,120) like '2008-05-07%'< ......