问题描述
- 使用SQL语句写语句查询
-
1.写函数GetSalaryByNumber,接收员工编号employee_number,返回此员工的工资标准employee_salary。
需要建表Employee,列为:employee_number:varchar(10),employee_salary:money。
解决方案
Create function AvgResult(@en varchar(10))
Returns money
As
Begin
Declare @es money
Select @es=select top 1 employee_salary from Employee where employee_number = @en
Return @es
End
解决方案二:
Nhibernate 使用sql语句查询
Hibernate使用sql语句实现多表关联查询
Hibernate使用sql语句实现多表关联查询
解决方案三:
Create function GetSalaryByNumber(@num varchar(10))
Returns money
As
Begin
return(select employee_salary from Employees where employee_number = @num)
End
时间: 2024-12-23 00:06:55