2006/5/31, Peter Brawley <peter.brawley@stripped>:
> Lew,
>
> >If I have another polynomial, say the sum of terms 1,3,4, and 5, how
> can I quickly search this
> >database to see if it's already been stored?
>
> SELECT DISTINCT polynomial_id
> FROM polynomial p1
> INNER JOIN polynomial p2 ON p1.term_id=1 AND p2.term_id=3
> INNER JOIN polynomial p3 ON p2.term_id=3 AND p3.term_id=4
> INNER JOIN polynomial p4 ON p3.term_id=4 AND p4.term_id=5
>
Make sure that there is no other concurrent connection when you're
doing it... (Since I expect then next step would be to insert this
polynome into the DB)
--
http://www.w-fenec.org/