• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
张继东
看铁蹄铮铮,踏遍万里河山。磨不破,打不烂。
   首页    新随笔    联系   管理    订阅  订阅

随笔分类 -  数据库

拆分字符串,并存入临时表中

摘要:create table #mytable(account nvarchar(10))declare @oldstring as nvarchar(3000)declare @tempstring as nvarchar(10)set @oldstring='10302299,10311441,10312196,10300104,10300297,10300381,10300509,103005... 阅读全文
posted @ 2005-12-14 16:38 简单生活 阅读(453) 评论(0) 推荐(0)
sql 计算某个时间段周六,日总数

摘要:Create PROCEDURE Busdays @from_dt datetime,@to_dt datetime ,@wkends int outputASDECLARE@days int,--天数@dp int ,--星期?@cnt int --计数set @wkends=0 --非工作日天数set @cnt=0set @days=datediff(d,@from_dt,@to_dt)whi... 阅读全文
posted @ 2005-11-15 15:29 简单生活 阅读(1106) 评论(0) 推荐(0)
dts导出到excel

摘要:表:EXEC master..xp_cmdshell 'bcp uttemp.dbo.abc out c:\temp01.xls -c -q -S"192.168.0.157" -U"sa" -P"777"'sql语句: EXEC master..xp_cmdshell 'bcp "select dt from uttemp.dbo.abc" queryout c:\temp01.xls -c -... 阅读全文
posted @ 2005-09-26 12:49 简单生活 阅读(620) 评论(0) 推荐(0)
朋友问的一个关于group by的sql

摘要:提问: 一个表有三个字段id,dt,d 分别存放id,时间,数值 id dt d 1 2004-08-11 12:12:00.000 9 2 2005-09-11 12:08:00.000 2 3 2005-08-11 12:12:00.000 6 4 2005-09-11 12:12:00.000 10 5 2005-08-11 12:12:00.000... 阅读全文
posted @ 2005-09-01 12:05 简单生活 阅读(1436) 评论(9) 推荐(0)

博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3