I have a table with two columns, ID And description. When ID = 1, the description represents the person’s name. When ID = 2, the description represents the person’s address. When ID is 3, the description represents the person’s comments.
What query must I do to select all three types of description. I tried using cases but that won’t work in my case. Union will work but I will be running my query three times. Is there a simpler and more effective way to do this?
I am guessing that you have some way to relate this data to a another table. If so, then you can use something like this:
This will give you the unique, data for each record in a specific row. You can then insert this data into another table.