S
subs
customer id customer New customer
10021 pg pg
10021 pgr pg
10022 dp dp
10022 dpa dp
10022 dp3 dp
i have two columsn of data which are populated. customer id and
customer. The column New customer has to be populated by an update
query such that new customer has to be equal to column customer when
ever they have equal customer ids. for example the first two entries
in the new colum are pg since they have equal customer ids. Now this
could be populated by either pg or pgr- but pg is repeated more no of
times in my original data . So new customer field will have pg in the
first two fields.
So pls let me know the query such that new customer colmn is populated
by using two crieteria
1) Customer id field values must be equl
2) when ever customer id field are same, then populate the last colum
with the value of the column customer which is repeated max no of
times.
THANKS
10021 pg pg
10021 pgr pg
10022 dp dp
10022 dpa dp
10022 dp3 dp
i have two columsn of data which are populated. customer id and
customer. The column New customer has to be populated by an update
query such that new customer has to be equal to column customer when
ever they have equal customer ids. for example the first two entries
in the new colum are pg since they have equal customer ids. Now this
could be populated by either pg or pgr- but pg is repeated more no of
times in my original data . So new customer field will have pg in the
first two fields.
So pls let me know the query such that new customer colmn is populated
by using two crieteria
1) Customer id field values must be equl
2) when ever customer id field are same, then populate the last colum
with the value of the column customer which is repeated max no of
times.
THANKS