我试图这样做加入,但它表示没有正确结束任何想法
SELECT
first_name, last_name, MAIL_COUNTRY_ID, EMAIL
FROM
people, PUBAUTHOR_PEOPLE
WHERE
people.people_id = PUBAUTHOR_PEOPLE.people_id
JOIN
select country
from countries
where country c on c.country_id = p.coutry_id
答案 0 :(得分:2)
尝试此查询:
SELECT
first_name, last_name, countries.country, email
FROM
people
JOIN pubauthor_people ON
People.people_id = pubauthor_people.people_id
JOIN countries ON
countries.country_id = people.mail_country_id
答案 1 :(得分:1)
你应该避免混合标准,并这样做:
select first_name, last_name, MAIL_COUNTRY_ID, EMAIL, countries.country
FROM people
join PUBAUTHOR_PEOPLE on people.people_id = PUBAUTHOR_PEOPLE.people_id
JOIN countries on countries.country_id = PEOPLE.country_id