Welcome Guest, Not a member yet? Register   Sign In
complex query or subquery to 'ignore' initial database records
#1

[eluser]jude[/eluser]
I have some standard code for getting data from a database:

function get_focus_news ($n1) {
$this->db->select('id, nid, date, title, intro');
$this->db->where('nid =', $n1);
$this->db->order_by('id desc');
$query = $this->db->get('focus', 15, 5);
return $query->result();
}

It gets 15 filtered records with the required 'nid', starting from the fifth filtered record.

How is the above routine implemented while ignoring the first 5 ACTUAL records of the database? How do we get the above routine to be implemented starting from the sixth ACTUAL record.

This, I suspect, requires a subquery to enable the routine to ignore the first 5 ACTUAL
records, as opposed to filtered records ?


Messages In This Thread
complex query or subquery to 'ignore' initial database records - by El Forum - 07-13-2009, 10:47 PM



Theme © iAndrew 2016 - Forum software by © MyBB