Employee
桌子
Designation
桌子
我想在指定表的结果集中显示指定。我正在使用 nic 搜索数据。
帮我
谢谢
select e.serial_no, d.designation, e.name, e.epf_no, e.appointment_date, e.nic, e.dob
from employee e, designation d
where e.designation = d.number and e.nic = 'the_number_you_want'
例如,如果我们必须为893041699 nic number
select d.designation from designation d
join employee e on d.number = e.serial_no
where e.nic=893041699; //example for nic number 893041699
显示输出如
designation
------------
Helper
Select * from employee a, designation b where a.serial_no = b.number and a.nic=921560419
试试这个:
select e.*, d.designation AS desi_name FROM employee AS e LEFT JOIN designation AS d ON e.serial_no=d.number
你进去desi_name