--0-1713295814-1210442987=:18955
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
Does postgresql have something similar to the ORDER BY FIELD feature found
in MySQL?
Something like ORDER BY FIELD(ID, 10, 2, 56, 40);
It is listed here:
http://dev.mysql.com/doc/refman/5.0/en/sorting-rows.html
I am using the Sphinx Search program, www.sphinxsearch.com, and it
returns a list of IDs ordered by relevance. I take the array it gives me
and create a comma separated list which is used in a postgres query using
the WHERE "ID" IN (10, 2, 56, 40) statement. I would like to order the
result by the order of the list.
Thanks.
---------------------------------
Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it
now.
--0-1713295814-1210442987=:18955
Content-Type: text/html; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
<div>Does postgresql have something similar to the ORDER BY FIELD feature
found in MySQL?</div> <div> </div> <div>Something like ORDER BY
FIELD(ID, 10, 2, 56, 40);</div> <div> </div> <div>It is listed
here: <A
href="http://dev.mysql.com/doc/refman/5.0/en/sorting-rows.html">http://dev.mysql.com/doc/refman/5.0/en/sorting-rows.html</A></div>
<div> </div> <div>I am using the Sphinx Search program, <A
href="http://www.sphinxsearch.com">www.sphinxsearch.com</A>,
and it
returns a list of IDs ordered by relevance. I take the array it
gives me and create a comma separated list which is used in a postgres
query using the WHERE "ID" IN (10, 2, 56, 40) statement. I would
like to order the result by the order of the list.</div>
<div> </div> <div>Thanks.</div><p> 
<hr size=1>Be a better friend, newshound, and
know-it-all with Yahoo! Mobile. <a
href="http://us.rd.yahoo.com/evt=51733/*http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
"> Try it now.</a>
--0-1713295814-1210442987=:18955--


|