- не работает (в отличие от MySQL):
:) SELECT r.region_id as region_id, r.name_ru as region_name, r.country_id as country_id, c.name_ru as country_name FROM geodata._regions_log as r LEFT JOIN geodata._countries as c USING(country_id) WHERE 1=1 ORDER BY r.name_ru LIMIT 0,10
SELECT
r.region_id AS region_id,
r.name_ru AS region_name,
r.country_id AS country_id,
c.name_ru AS country_name
FROM geodata._regions_log AS r
LEFT JOIN geodata._countries AS c USING (country_id)
WHERE 1 = 1
ORDER BY r.name_ru ASC
LIMIT 0, 10
Received exception from server:
Code: 60. DB::Exception: Received from localhost:9000, ::1. DB::Exception: Table geodata.geodata._countries doesn't exist..
0 rows in set. Elapsed: 0.034 sec.
🚫 Задвоенная БД? - убираем ваще. Но и так - не работает:
:) SELECT r.region_id as region_id, r.name_ru as region_name, r.country_id as country_id, c.name_ru as country_name FROM _regions_log as r LEFT JOIN _countries as c USING(country_id) WHERE 1=1 ORDER BY r.name_ru LIMIT 0,10
SELECT
r.region_id AS region_id,
r.name_ru AS region_name,
r.country_id AS country_id,
c.name_ru AS country_name
FROM _regions_log AS r
LEFT JOIN _countries AS c USING (country_id)
WHERE 1 = 1
ORDER BY r.name_ru ASC
LIMIT 0, 10
Received exception from server:
Code: 47. DB::Exception: Received from localhost:9000, ::1. DB::Exception: Unknown identifier: c.name_ru.
0 rows in set. Elapsed: 0.021 sec.
Спасибо за внимание
Спасибо за примеры! Это старая проблема, нам давно пора это исправить. Постепенно делаем.
Обсуждают сегодня