Page 1 of 1

Wie man umwandelt, wo größer als die Bedingungen in den aktiven Datensatz von Codesigniter sind

Posted: 03 Jun 2025, 08:04
by Anonymous
das ist was ich will: < /p>

Code: Select all

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
< /code>
Ich habe dies ausprobiert und ich bekomme die gewünschten Namen, aber auch zusätzliche 12 Namen. Etwas stimmt nicht. < /P>
$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();