Skip to content
Advertisement

Specific hierarchy geography

I have a table geography with three levels

enter image description here

I need to display the level3 only for level2 = France, Benelux and for the other countries level2 = level 3

Result Example:

enter image description here

Advertisement

Answer

 Select
  level1,
  level2,
  Case when level2 in ('France', 'Benelux') then level3 else level2 end as level3
 from geography;
User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement