I have a sample table as follows.
ID Name Code Address
----+---------------+--------+----------------
1 | Sydney Hall | SH | 11 Abc Street
2 | Sydney Hall | SH | 23 Abc Street
3 | Main Hall | MH | 74 Xyz Street
4 | Odyssey Hall | OH | 133 AbZ Street
5 | Odyssey Hall | OH | 28 Xyx Street
I would like to select individual code entries as well as an identifier and a name for these different entries. For the table above, I would like to get the following (so I ignore the addresses of the building).
ID Name Code
----+---------------+--------+
1 | Sydney Hall | SH
3 | Main Hall | MH
4 | Odyssey Hall | OH
This is probably Left Join, but I cannot assemble it correctly (especially since I select data from a single table). Does anyone have any ideas about this? Thank.
user2014963
source
share