Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have the below table as source.
ID | Name | Available |
---|---|---|
1 | Aarthi | 0 |
1 | Aarthi | 0 |
1 | Aarthi | 50 |
1 | Aarthi | 50 |
2 | Nikhil | 50 |
2 | Nikhil | 0 |
2 | Nikhil | 50 |
3 | Yogesh | 0 |
3 | Yogesh | 0 |
From the above sample data I want to generate the flag as below:
ID | Name | Available | Flag |
---|---|---|---|
1 | Aarthi | 0 | 1 |
1 | Aarthi | 0 | 1 |
1 | Aarthi | 50 | 0 |
1 | Aarthi | 50 | 0 |
2 | Nikhil | 50 | 1 |
2 | Nikhil | 0 | 0 |
2 | Nikhil | 50 | 2 |
3 | Yogesh | 0 | 1 |
3 | Yogesh | 0 | 1 |
Please help me out to generate the above flag.
Ok but what are those flags based on?
Why is it 1 or 0 or 2? What is the condition you want to use?
At some places 50 is having Flags 1,2 & 0 for same Name.
Can you share the logic as to how you are doing this?