我有两张桌子 competition_registration
和competition_schedule
. 我有 wa select 查询,用于从中选择行competition_registration
。这是我的代码,如下所示:
$this->db->select('competition_registration.permenent_registration_number');
$this->db->from('competition_registration');
$where = "permenent_registration_number is NOT NULL";
$this->db->where($where);
$this->db->join('competition_schedule', 'competition_schedule.competition_schedule_id = competition_registration.competition_schedule_id');
$this->db->join('competition_schedule', 'competition_schedule.period_id = 6');
$this->db->join('competition_schedule', 'competition_schedule.competition_level_id = 3');
$query = $this->db->get(); echo $this->db->last_query();exit;
但这显示了一个错误。任何人都可以检查这个查询并为我纠正它吗?
我想从两个表中选择相同competition_schedule_id
且competition_level_id
等于 3 和period_id
等于 6 的competition_schedule
table 列。