Hi Friends,
I have following query looking for solution.
Table AAA ; SalesmanID char (02)
Customer ID char (15)
NRec int
Srno int
Existing Data:
SalesmanID Customer ID NRec SRNO
90 ALKUP001 3 0
90 ALKHT712 3 0
90 NYKY8920 3 0
92 CHG8993 2 0
92 DLK8837 2 0
Looking for Result:
Data: SalesmanID Customer ID NRec SRNO
90 ALKUP001 3 1
90 ALKHT712 3 2
90 NYKY8920 3 3
92 CHG8993 2 1
92 DLK8837 2 2
Can some one provide the SQL query how to update srno field starting with 1 based on NREC field group by salesmanID.
Generating serial number by Salesman ID.
Thanks
SM
I have following query looking for solution.
Table AAA ; SalesmanID char (02)
Customer ID char (15)
NRec int
Srno int
Existing Data:
SalesmanID Customer ID NRec SRNO
90 ALKUP001 3 0
90 ALKHT712 3 0
90 NYKY8920 3 0
92 CHG8993 2 0
92 DLK8837 2 0
Looking for Result:
Data: SalesmanID Customer ID NRec SRNO
90 ALKUP001 3 1
90 ALKHT712 3 2
90 NYKY8920 3 3
92 CHG8993 2 1
92 DLK8837 2 2
Can some one provide the SQL query how to update srno field starting with 1 based on NREC field group by salesmanID.
Generating serial number by Salesman ID.
Thanks
SM