Forum Discussion
shkl_
Apr 09, 2022Copper Contributor
How to create category based on 1 column
Hi all,
I am new to SQL and I am finding a way to categorise 1 column in my table.
Currently I have 1 column called ID and I want to add 1 column that determine the category of that ID. My desired out is as following:
ID | Category |
1 | a |
2 | b |
3 | a |
4 | a |
5 | b |
The thing is, for 1 category alone, I have like 50+ ID involved, and I have 20+ categories. How do I create a query to simplify this? Many thanks.
- MahdiKhalilNejadCopper Contributormaybe you can do this with stored procedure and function