I am still new to SQL and was wondering what would be the best option to get distinct category names from two different columns from the same table.
Example:
Table Name: Fruits
ID CAT1 CAT2
1 APPLE PEACH
2 PEACH GRAPE
3 APPLE GRAPE
4 ORANGE APPLE
5 PEACH PEAR
Desired Output
Distinct CAT
APPLE
PEACH
GRAPE
ORANGE
PEAR
I know that I would want to do a join where I name each table a letter like fruits a and fruits b so I match it via the ID but I cannot figure how to display it in one column only the distinct CAT from both columns.