Click here to Skip to main content
13,548,424 members
Rate this:
 
Please Sign up or sign in to vote.
i have a patient number 1
If patient=Normal then
series is of type
ln00001

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

1 solution

Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

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.
  Permalink  

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

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy |
Web04 | 2.8.180515.1 | Last Updated 6 Dec 2012
Copyright © CodeProject, 1999-2018
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100