随笔分类 -  sql server

摘要:读取数据 var model = db.Database.SqlQuery<类>("exec 存储过程名字 @type,@town,@village", paras).ToList(); 执行存储过程 var data = db.Database.SqlQuery< 类 >("select * .. 阅读全文
posted @ 2017-12-11 17:24 enych 阅读(438) 评论(0) 推荐(0)
摘要:select * from info where typeid= 1 and xxx is NOT null select * from info where typeid= 1 and xxx is null 阅读全文
posted @ 2017-11-27 09:49 enych 阅读(4981) 评论(0) 推荐(0)
摘要:select count(*) from vote group by contents select count(*) from (select TOP 100 PERCENT * from vote order by contents)as A group by contents select * from vote --统计 1 和 2 和 3 的个数 显示一个表 默认升序 [第一个是... 阅读全文
posted @ 2017-11-24 18:03 enych 阅读(160) 评论(0) 推荐(0)
摘要:use test select * from vote insert into vote (contents) values(GETDATE()) insert into vote (contents,timess,AAA) values ('ss',GETDATE(),GETDATE()) --插入数据时 不能为空值的列名必须 写上, 能为空的可以不写 select AAA from vote... 阅读全文
posted @ 2017-11-23 10:29 enych 阅读(3930) 评论(0) 推荐(0)
摘要:1 --插入数据修改不行;必须提供学号 2 insert into Student(生日类型) values('阳历') 3 4 --把月份提取出来 显示两位数 5 select DATENAME(month,getdate()) 6 SELECT convert(varchar(20),DATENAME(month,getdate())) 7 8 ----把月份提取出来 ... 阅读全文
posted @ 2017-09-05 10:18 enych 阅读(830) 评论(0) 推荐(0)