2008年2月20日

[导入]案例20080220 列出台籍人员全年出勤

摘要: select no,name,kqrq,weeks,sksj,ycq,cqxs,kgxs,ycyy,qjxs,jzmc from rb200701 where bmmc like '%台籍%' union allselect no,name,kqrq,weeks,sksj,ycq,cqxs,kgxs,ycyy,qjxs,jzmc from rb200702 where bmmc like '%台籍... 阅读全文

posted @ 2008-02-20 23:18 梦飞天蝎 阅读(5884) 评论(0) 推荐(0) 编辑

[导入]表变量在存储过程中出现了"必须声明变量"的错误,已经声明了啊

摘要: 如果表名要用变量给定,要用exec() eg: DECLARE @Order Table(OrderNo varchar(50)), @sql varchar(8000) select @sql='Insert '+@Order+' Select OrderNo From Tab... 阅读全文

posted @ 2008-02-20 22:48 梦飞天蝎 阅读(539) 评论(0) 推荐(0) 编辑

[导入]SQL Server字符串处理函数大全

摘要: SQL Server字符串处理函数大全 select语句中只能使用sql函数对字段进行操作(链接sql server),select 字段1 from 表1 where 字段1.IndexOf("云")=1;这条语句不对的原因是indexof()函数不是sql函数,改成sql对应的函数就可以了。left()是sql函数。select 字段1 from 表1 where charindex('云',... 阅读全文

posted @ 2008-02-20 21:25 梦飞天蝎 阅读(181) 评论(0) 推荐(0) 编辑

[导入]sql server 的日期转换函数

摘要: sql server 的日期转换函数CREATE FUNCTION fn_DateToFormatString(@date datetime, @format varchar(20)) RETURNS varchar(20) AS BEGIN DECLARE @result varchar(20) SELECT @result = replace(replace(replace(replace(r... 阅读全文

posted @ 2008-02-20 21:24 梦飞天蝎 阅读(194) 评论(0) 推荐(0) 编辑

union all 和union

摘要: union all 和union 阅读全文

posted @ 2008-02-20 15:56 梦飞天蝎 阅读(81) 评论(0) 推荐(0) 编辑

SQL sever中根据日期判断今天是星期几

摘要: select datename(weekday,getdate()) 結果: ------------------------------ 星期三 (影響 1 個資料列) 阅读全文

posted @ 2008-02-20 15:55 梦飞天蝎 阅读(820) 评论(0) 推荐(0) 编辑

导航