![](https://img-blog.csdnimg.cn/20201014180756930.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
sqlserver
weixin_42545230
这个作者很懒,什么都没留下…
展开
-
sqlserver 相关知识
1、 使用delete语句删除的是整行记录,而并非是记录中的某个字段值。2、update,delete语句中记得加where,不然是更新所有行。3、 查询空值用IS NULL。4、查询后字段出现重复值,可以用DISTINCT;但是DISTINCT会降低效率,group by(分类汇总)更好。SELECT DISTINCT classFROM student SELECT class_id FROM studentGROUP BY class_id5、范围查询时,不仅可以用大小于还可以用b原创 2020-10-14 16:09:50 · 73 阅读 · 0 评论 -
sqlserver 自表查询
select m.* , n.* from tb m , tb n where m… = n…SELECT m.stu_id,m.stu_name,result,cou_name FROM student m,score,courseWHERE score.stu_id=m.stu_id and score.cou_id=course.cou_idORDER BY stu_name类似于把m赋值为student原创 2020-10-12 16:36:09 · 153 阅读 · 0 评论 -
SQLServer 整型数据类型
【bigint】从 -2^63 (-9223372036854775808) 到 2^63-1 (9223372036854775807) 的整型数据(所有数字)。存储大小为 8 个字节。【int】从 -2^31 (-2,147,483,648) 到 2^31 - 1 (2,147,483,647) 的整型数据(所有数字)。存储大小为 4 个字节。int 的 SQL-92 同义字为 integer。【smallint】从 -2^15 (-32,768) 到 2^15 - 1 (32,767) 的整转载 2020-10-12 13:28:22 · 2418 阅读 · 0 评论