Этот запрос:
select chefnr from tablename where name = 'John'
вернет 100
в столбец chefnr
.
Вы можете использовать это так:
select name from tablename
where enr = (select chefnr from tablename where name = 'John')
чтобы получить имя шеф-повара Джона.
См. демо .
Результат:
| name |
| ----- |
| Frank |