在表现时动态创造 [英] Dynamically create When experssion
本文介绍了在表现时动态创造的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
SELECT EmpId,
EmpName=CASE
WHEN EmpName='Mahesh'; THEN 'Dasari Mahesh';
WHEN EmpName='Prasanthi'; THEN 'Donthi Prasanthi';
........
ELSE;
END,
Role
FROM Employeedetails
如何动态创建超过50个语句 EmpName = Mahesh 该值来自数据库
推荐答案
您还没有提供完整的信息来帮助您。下面我想帮助你了解我的理解和你的信息。
我在考虑你的餐桌结构是......
Hi,
You have not provided full information to help you. Below i am trying to help you out on my understanding and your info.
Here i am considering your table structure is...
EmpId,
EmpName,
EmpFullName
.
.
and so on.
检查这个...
Check this ...
Create proc pr_emp_info
(
@pa_empName varchar(100)
)
AS
BEGIN
SELECT EmpId, EmpFullName, Role from EmployeeDetails where empname=@pa_empName
END
希望这会对你有所帮助。
干杯
Hope this will help you.
Cheers
这篇关于在表现时动态创造的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文