"SELECT TOP 1" equality for codeigniter?
with LIMIT
$this->db->limit(1);$query = $this->db->get('my_table');$myRow = $query->row();
with OFFSET and LIMIT
$query = $this->db->get('mytable', 0, 1);$myRow = $query->row();
Not sure about codeigniter, but you could do a regular select and order by and just use the first record that is returned, i.e. ignore the ones that would come after that.
Basically, that is what the SQL engine is doing for you when you specify TOP 1
.