<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br>Le 9 juin 2010 à 14:22, Ivan Smahin a écrit :<br><br><blockquote type="cite">Hello Christian,<br></blockquote><i>Hello Ivan,<br></i><blockquote type="cite"><br>Wednesday, June 9, 2010, 2:58:57 PM, you wrote:<br><br><br><blockquote type="cite">Le 9 juin 2010 à 09:56, Ivan Smahin a écrit :<br></blockquote><br><blockquote type="cite"><blockquote type="cite">Hello Christian,<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">Wednesday, June 9, 2010, 2:47:20 AM, you wrote:<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">Hello,<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">I have this request :<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">SELECT t1.idScrap, (t1.pertinence + t2.pertinence) as s FROM<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">kw_in_scrap as t1, kw_in_scrap as t2 WHERE (t1.kw = 'musique' and<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">t2.kw = 'cuivre' and t1.idScrap = t2.idScrap) ORDER BY s DESC<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">but I have wrong values for s in the results and I don't know why.<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">Example :<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">idscrap, kw, pertinence<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">1, musique, 1<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">1, cuivre, 0.25<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">1, son, 0.5<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">2, musique, 1<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">2, bruit, 0.25<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">2, cuivre, 0.3333<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">I want to have :<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">idscrap, s<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">1, 1.25<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">2, 1.3333<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">but I have<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">2, 0.6666<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">1, 0.5<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">Seems to be a bug. Please report it to the Mantis.<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">second problem : in Director, order by s is ignored and Valentina make an order by recid in fact...<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">You mean it is expected sort order with vStudio and no sort order<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">with V4MD?<br></blockquote></blockquote><br><blockquote type="cite">yes, but in two cases, "s" is not correct<br></blockquote><br>Agree. It will be fixed ASAP. Please report it to Mantis.<br><br><blockquote type="cite"><blockquote type="cite">If so then you should just update your V4MD - because it was fixed<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">already.<br></blockquote></blockquote><br><blockquote type="cite">in which version?<br></blockquote><blockquote type="cite">have you an url ?<br></blockquote><br>I guess it was in 4.5<br><br>BTW the workaround is -<br><br>Group all the records you want and sum pertinence.<br>Something like this:<br><br>SELECT<br> idScrap, <br> SUM(pertinence) as s <br>FROM <br> kw_in_scrap<br>WHERE <br> kw = 'musique' <br> OR kw = 'cuivre' <br>GROUP BY<br> idScrap<br>ORDER BY <br> s DESC <br></blockquote><br><br><i>This request doesn't match what I'm expecting for.<br><br>In fact, I want to find idscrap which has kw1 AND kw2 and I want to have the addition of pertinence of kw1 and pertinence of kw2 for this idscrap.<br>I don't want idscrap which has only one of the kw and I don't want the global sum of pertinence.</i><br><blockquote type="cite"> <br></blockquote><br><i>br<br>Christian</i><br><blockquote type="cite"><br><br>-- <br>Best regards,<br>Ivan Smahin <br>Senior Software Engineer<br>Paradigma Software, Inc<br>Valentina - The Ultra-Fast Database<br><a href="http://www.valentina-db.com">http://www.valentina-db.com</a><br><br>_______________________________________________<br>Valentina mailing list<br>Valentina@lists.macserve.net<br>http://lists.macserve.net/mailman/listinfo/valentina<br></blockquote><br></body></html>