摘要:        
1、存储过程: 相当于函数,四要素:输入,输出,函数名,函数体 创建存储过程: create proc(这是存储过程的关键字) 存储过程名 | ( create proc SelectAll 参数 @a int, @b int | as 函数体 | as select *from Student |    阅读全文
        
            posted @ 2017-03-16 15:28
朱利军
阅读(412)
评论(0)
推荐(0)
        
            
        
        
摘要:        
1、定义变量: declare @变量名 数据类型 (变量名开始必须是@) declare @a int ; 2、赋值: 方法1:set @变量名 = 值(不推荐); 方法2:select @变量名 = 值; declare @a nvarchar(10); set @a='aaa' select     阅读全文
        
            posted @ 2017-03-16 14:46
朱利军
阅读(932)
评论(0)
推荐(0)
        
            
        
        
摘要:        
表连接 1、select * from student,score ——笛卡尔积 2、两个表的连接: 法1:select student.sno, sname, degree from student,score where student.sno=score.sno 当查询的列名两个表中都有时要在    阅读全文
        
            posted @ 2017-03-16 11:09
朱利军
阅读(470)
评论(0)
推荐(0)
        
            
        
        
摘要:        
1、聚合函数: 1、max最大值 select max(price) from car where code='c024' 2、min最小值 select * from car where oil= (select min(price) from car) 3、avg平均值 select avg(p    阅读全文
        
            posted @ 2017-03-16 10:55
朱利军
阅读(360)
评论(0)
推荐(0)
        
 
                    
                     
                    
                 
                    
                 
 
         
         浙公网安备 33010602011771号
浙公网安备 33010602011771号