这就是我要的:
SELECT DISTINCT first_name,last_name
FROM employees e
INNER JOIN salaries s ON e.emp_no = s.emp_no
WHERE e.birth_date > '1963-01-01'
AND s.salary>150000
我已经尝试过了,我得到了我想要的名字,还有另外 12 个名字。出了点问题。
$this->db->distinct();
$this->db->select('first_name, last_name');
$this->db->from('employees');
$this->db->join('salaries s', 'e.emp_no = s.emp_no', 'inner');
$this->db->where('e.birth_date > 1963-01-01');
$this->db->where('s.salary > 150000');
$result = $this->db->get();