linq 获取数据库时间 或者执行其他带返回值的sql查询
using (LongXingDBDataContext db = new LongXingDBDataContext())
{
DeviceInfo di;
di = new DeviceInfo();
var a = db.ExecuteQuery<DateTime>("select getdate()",new object[] {});
di.CreateDate = a.First();
db.DeviceInfo.InsertOnSubmit(di);
db.SubmitChanges();
this.toolTip1.Show("保存完毕", this, ((Control)sender).Location, 2000);
}
相关文档:
dim conn,connstr
Set conn = Server.CreateObject("ADODB.Connection")'创建一个数据库链接对象conn,方便后面调用
connstr="Provider=SQLOLEDB;Data Source=(local);Initial Catalog=111;User ID=sa;Password=1234;" '创建一个数据库的recordset对象,方便以后调用
conn.Open connstr'打开数据库 ......
上集中
//////////////////////////////////////////////////
select n5001 门店,n5002 部门,n5004 小分类,n5019 商品编码,c01d21 商品名称,
nvl(xse,0)-nvl(dzxs,0) 销售,
mle 毛利,
nvl(xl,0)-nvl(dzsl,0) 销量
from
(select n5001,n5002,n5004,n5019,sum(n5011) xse,sum(n5016) mle,sum(n5023) xl
from ......
order by 的数值型灵活使用
select * from table_a where id=p_id order by decode(函数,'asc',1,'desc',-1)*jsny;
控制试图的访问时间:
6.create view ...
as
select ... from where exists(select x from dual where sysdate>=8:00am and sysdate<=5:00pm)
妙用decode实现排序
select * from tabnam ......
根据生日的xx月xx日查找在$checkDate计算,$before日后生日的客户:
$checkDate为YYYY-MM-DD
WHERE substring(ADDDATE( '$checkDate', $before ),6,10)=substring(DATE_FORMAT(birthday,'%Y-%m-%d'),6,10)
$dates 天内生日的客户未考虑到平年、闰年::
$sql.=" (dayofyear( birthday )-dayofyear( ......
@ECHO OFF
ECHO /////////////////////////////////////////////////
ECHO // Microsoft SQL Server 2005 整合、集成SP3
ECHO // Author : cxygoo
ECHO // Date : 2008-12-22
ECHO /////////////////////////////////////////////////
ECHO 运行此批处理前,得建目录:C:\SQL2005,C:\SQL200 ......