Skip to content
Advertisement

Is there a SQL syntax that will create new column by searching in 2 columns based on equal value of 3rd column in same table?

I have 1 table, with fields named: class_code, name1, class_code1, name2, class_code2. I would like to search the value of class_code, and display it as class_code and name only, where class_code = class_code1 or class_code = class_code2. The results will display class_code and name

Is this possible using sql join syntax?

This is the table:

The output I need is:

Advertisement

Answer

If I got it right

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement