Re: selecting the 'best' match

2009-05-15 Thread Joerg Bruehe
Hi! blackwater dev wrote: I have a hold car data such as color, model, make, year, etc. I want to allow the user to answer some questions and I'll present them with the car that 'best' matches their criteria. How do I do this? I still want to return ones that don't match exactly but want

selecting the 'best' match

2009-05-12 Thread blackwater dev
I have a hold car data such as color, model, make, year, etc. I want to allow the user to answer some questions and I'll present them with the car that 'best' matches their criteria. How do I do this? I still want to return ones that don't match exactly but want the closer matches ordered at

Re: selecting the 'best' match

2009-05-12 Thread Johan De Meersman
you *could* go with if-statements, returning a numerical weight for each criterion if match and 0 if not; summing those and sorting by the sum column. I would do it in code, though - it may or may not be less efficient, but it'll be easier to maintain and read. On Tue, May 12, 2009 at 5:50 PM,

Re: selecting the 'best' match

2009-05-12 Thread Gerald L. Clark
blackwater dev wrote: I have a hold car data such as color, model, make, year, etc. I want to allow the user to answer some questions and I'll present them with the car that 'best' matches their criteria. How do I do this? I still want to return ones that don't match exactly but want the

Re: selecting the 'best' match

2009-05-12 Thread blackwater dev
Thanks but doing it in code would require me to pull in the entire car table and process it. With potentially tons of rows, seems like I should be able to use the db to get those. On Tue, May 12, 2009 at 12:23 PM, Johan De Meersman vegiv...@tuxera.bewrote: you *could* go with if-statements,

Re: selecting the 'best' match

2009-05-12 Thread Johan De Meersman
not if you did it in a stored procedure. Given that it's gonna be pretty hard to use indices on this anyway (I think), you're gonna scan the entire table anyway. That's what you get for fuzzy searches. On Tue, May 12, 2009 at 6:55 PM, blackwater dev blackwater...@gmail.comwrote: Thanks but

Re: selecting the 'best' match

2009-05-12 Thread Curtis Maurand
in your code, you can define ranges of say if the model year being looked for is 2002, then present model years 2000 thru 2004. --Curtis blackwater dev wrote: Thanks but doing it in code would require me to pull in the entire car table and process it. With potentially tons of rows, seems