views:

19

answers:

3

I have table where member_id gets inserted for different user. I want to delete the enteries of member_id except recent two entries for each member in the table.

Tell me the optimized way because its a very large table.

i.e table should has 2 recent entries for each member.

I need query in mysql 4.X.X.X

Please help me.

http://www.winsoftwares.net

A: 

what defines the most recent is the a rowdate,datetime or is the member_id cronological?

icecurtain
The colom BIGINT having data in YdmHis i.e 20100917133000
Mohammad
A: 

Please let me know the answer of the above.

http://www.winsoftwares.net

Mohammad
A: 

$recent = $this->db->insert_id();
$sql = delete from tbl_manager where sno $this->db->query();

Madan Sapkota