Click here to Skip to main content
15,889,034 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
i have a patient number 1
If patient=Normal then
series is of type
ln00001

If patient=LAMAthen
series is of type
L00001
Posted
Updated 5-Dec-12 22:31pm
v4

1 solution

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

i will suggest the following solution

SQL
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.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900