[eluser]boony[/eluser]
Hi,
I have a simple problem which is greater than my simple mind can handle.
Essentially, I want to remove duplicate entries from a table and insert the result into a new table. The following query works a treat:
$this->db->query('INSERT INTO courses SELECT DISTINCT coursecode, coursename FROM tempcourse');
The origin was a csv file which I read into tempcourse. The new table 'courses' is created via dbforge and the above query is executed and results are as expected.
But surely this can be achieved by using active record syntax. I've tried a few different passes but nothing works except the above query!
Any suggestions to simplify the above would be gratefully appreciated.