我怎么能在sql server 2000中自动生成这种类型的系列 [英] how can i auto generate such type of series in sql server 2000

查看:73
本文介绍了我怎么能在sql server 2000中自动生成这种类型的系列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的病人数为1

如果患者=正常则

系列的类型为

ln00001



如果患者= LAMAthen

系列类型为

L00001

解决方案

考虑一个名为 - ''table_name''

的表,并且列有' - 'Patient_Type'',''Patient_ID''



i将建议以下解决方案



 选择 
result = case Patient_Type
' 正常' 然后 ' ' LAMA' 然后 ' L0000' + Patient_ID
end
< span class =code-keyword> from table_name





如果有效,请检查并屏蔽答案。


i have a patient number 1
If patient=Normal then
series is of type
ln00001

If patient=LAMAthen
series is of type
L00001

解决方案

considering a table named as - ''table_name''
and having columns- ''Patient_Type'', ''Patient_ID''

i will suggest the following solution

select 
result=case Patient_Type 
       when 'Normal' then 'ln0000'+Patient_ID 
       when 'LAMA' then 'L0000'+Patient_ID 
       end
       from table_name 



Please check and mask as answer if it works.


这篇关于我怎么能在sql server 2000中自动生成这种类型的系列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆