$sql = 'select * from tab_city where fatherID=0'; $list = $this->db->query($sql); //原生sql
$query = $this->db->get('mytable'); //select * from mytable
$query = $this->db->get('mytable', 10, 20);//limit10,20
$query = $this->db->get_where('mytable', array('id' => $id), $limit, $offset); //where id=$id limit $limit,$offset
$this->db->select('title, content, date'); //SELECT title, content, date
$this->db->from('mytable');//from mytable
$this->db->join('comments', 'comments.id = blogs.id');//JOIN
$this->db->join('comments', 'comments.id = blogs.id', 'left');//LEFT JOIN
$this->db->where('name', $name); //WHERE name = 'Joe'
$this->db->where('name !=',