Find records either side of the record found

Find records either side of the record found

Post by Iain Adam » Sat, 16 Jun 2007 20:48:43


I need to search a table and find a specific record. This I can do,
altho I then need to find 49 people either side of this record when
ordered by rank.

I.e I have loads of people who are ranked. Want to choose a player and
then find the people either side of that player.
 
 
 

Find records either side of the record found

Post by Willem Bog » Sat, 16 Jun 2007 21:21:39

> I need to search a table and find a specific record. This I can do,

Sounds like a job for the HANDLER statement:

http://www.yqcomputer.com/

Best regards,
--
Willem Bogaerts

Application smith
Kratz B.V.
http://www.yqcomputer.com/

 
 
 

Find records either side of the record found

Post by strawberr » Sat, 16 Jun 2007 22:29:53

On Jun 15, 1:21 pm, Willem Bogaerts


I never even heard of the HANDLER! Definitely looks worth getting
into...
A long, long time ago I had a stab at doing something this, using a
bit of php to determine the limits.
My solution varied the resultset according to where in the overall
rankings the specified row appeared, so if the top ranked row was
selected it would show that and n succeeding rows, the bottom ranked
row would show n preceeding values, and a row somewhere in the middle
would show 1/2n rows either side.

See
http://www.yqcomputer.com/ #37aa58773be074e8
 
 
 

Find records either side of the record found

Post by Iain Adam » Sat, 16 Jun 2007 23:23:25

On 15 Jun, 13:21, Willem Bogaerts


I have been trying this Handler thing and am getting some results. But
I can only achieve what I want by doing 2 statement and then
concatenating the results using PHP. Is is possible to do a JOIN on
two HANDLER statements. I have tried but seem to be getting errors. Is
this possible or is it just my syntax wrong.

Also thanks strawberry, I had never heard of the handler either but it
seems fairly good.
 
 
 

Find records either side of the record found

Post by lark » Tue, 19 Jun 2007 06:59:58


indeed, very interesting. thanks for mentioning it.