米字键

博客园 首页 新随笔 联系 订阅 管理

随笔分类 -  sql

摘要:DECLARE @DateTimeStr NVARCHAR(20) SET @DateTimeStr = CONVERT(NVARCHAR(20), GETDATE(), 112) + '_' + REPLACE(CONVERT(NVARCHAR(20), GETDATE(), 108), ':', 阅读全文
posted @ 2025-05-29 18:36 米字键 阅读(15) 评论(0) 推荐(0)

摘要:查询用户取水记录 select u.UserName, u.OpenId, c.CompanyName, c.CompanyCode, tr.Id, tr.RealVolume, tr.StationId, tr.CreateTime, tr.ReceiptTime from 数据库.dbo.[用户 阅读全文
posted @ 2025-04-02 17:42 米字键 阅读(51) 评论(0) 推荐(0)

摘要:1、SQL语句选择每月的数据添加到另一张表 insert into _Data_Collect_20231108 (RECORD_ID,RTU_ID,DataType,Time,Value,INSERT_TIME,I_Flag) select RECORD_ID,RTU_ID,DataType,Ti 阅读全文
posted @ 2023-12-19 14:56 米字键 阅读(100) 评论(0) 推荐(0)

摘要:-- 部门表 create table dept( deptno int primary key auto_increment, -- 部门编号 自动增长 dname varchar(14) , -- 部门名字 loc varchar(13) -- 地址 ) ; -- 修改表的字符集 alter t 阅读全文
posted @ 2022-04-04 17:11 米字键 阅读(135) 评论(0) 推荐(0)

摘要:create table student( sid int(11) primary key not null,-- 唯一标识,不能为空 sname char(25) not null,-- 不能为空 age int(11) not null,-- 不能为空 sex char(2) not null, 阅读全文
posted @ 2022-04-04 17:09 米字键 阅读(284) 评论(0) 推荐(0)