9函数和索引.pptVIP

  • 5
  • 0
  • 约1.18千字
  • 约 30页
  • 2017-06-12 发布于浙江
  • 举报
9函数和索引

第 9章 函数和索引 ;9.1 函 数;9.1 函 数;9.1 函 数;9.1 使用函数的例子1;9.1 使用函数的例子2;9.1 使用函数的例子3;9.1 使用函数的例子4;9.1 自 定 义 函 数;9.1 自 定 义 函 数;例:创建函数f(x)=x*x+2x+1,并输入值计算 第一步:创建函数,并运行 Use school go Create function f(@x int) Returns int Begin return (@x*@x+2*@x+1) End go 第二步:带入数据计算 Use school Go Select dbo.f(3) AS ‘参数为3的函数计算结果’ go;9.1 自 定 义 函 数;例:创建一个函数,在输入学生编号后,输出学生、老师的姓名 第一步:创建函数select_students,并运行 Use school Create function select_students (@id int) Returns table AS Return ( select s.name AS ‘学生姓名’,t.name AS ‘教师姓名’    from student s inner join teac

文档评论(0)

1亿VIP精品文档

相关文档