select nume as "Nume", adresa as "Adresa",localitate as "Localitatea"
from info
left join angajati
on id_i = id_a
where localitate like "Orhei"
and year(curdate()) - year(data_nast) >=50
我有2个带有nume字段的表,但出现错误,请帮助我现在不理解为什么此代码不起作用!
最佳答案
由于要在id_i
和id_a
列上进行联接,因此两个nume
列在联接结果中是不同的。指定您要表示的表的nume
列:
SELECT info.nume AS "Nume" ...
要么
SELECT angajati.nume AS "Nume" ...