Hi, I have the following query which works OK but need to amend it so that the value of pat ID (will be a concatenation of the incremented value + pracID) as shown in the example below... select *, row_number() over (partition by pracid order by pracid) as PatID from dbo.QryPatientExtraction WITH (tablock) order by pracid, patid
Current Results, PracID PatID20001 120001 220001 320002 120002 220003 1
I want to formulate the above query to outputPracID PatID20001 12000120001 22000120001 32000120002 12000220002 22000220003 120003
Thanks