cwin is the unique identfier for a person,
with the query before if a person has 2 records i would get a 2 in column row_count, but how would i do this, if i want a 1 on the first record and then a 2 on the second record, currently since there are 2 records for the cwin, i get a 2 in both columns.
how would i do it, so i get a 1 in the 1st record and then a 2 in the 2nd record
select *
from appraisal_F f
inner join (select cwin, count(*) as a
from appraisal_F
group by cwin ) as row_count on d.cwin = f.cwin
with the query before if a person has 2 records i would get a 2 in column row_count, but how would i do this, if i want a 1 on the first record and then a 2 on the second record, currently since there are 2 records for the cwin, i get a 2 in both columns.
how would i do it, so i get a 1 in the 1st record and then a 2 in the 2nd record
select *
from appraisal_F f
inner join (select cwin, count(*) as a
from appraisal_F
group by cwin ) as row_count on d.cwin = f.cwin