I have a table like below
Date | Bill No | Category |
---|---|---|
30-09-2024 | 1 | VSS |
1-10-2024 | 2 | RSS |
01-09-2024 | 3 | VSS |
1-10-2024 | 3 | RSS |
I need new category like below
Date | Bill No | Category | New Category |
---|---|---|---|
30-09-2024 | 1 | VSS | VSS |
1-10-2024 | 2 | RSS | RSS |
1-10-2024 | 3 | VSS | VSS |
1-10-2024 | 3 | RSS | VSS |
1-10-2024 | 4 | RSS | RSS |
1-10-2024 | 4 | RSS | RSS |
Note: If bill Date is same and Bill No is duplicate then consider VSS.
I tried
SELECT Date, BillNo, Category
, case when [Category]='VSS' then 'VSS' else 'RSS' end [New CATEGORY]
FROM TBL
You need to sign in to view this answers