List:General Discussion« Previous MessageNext Message »
From:Pooly Date:May 31 2006 5:18pm
Subject:Re: Need help querying a database of polynomials
View as plain text  
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/
Thread
name 'Szczech' returns more rows then 'Szczec%'Lukasz Budnik31 May
  • Need help querying a database of polynomialsLew E. Lefton31 May
    • Re: Need help querying a database of polynomialsPeter Brawley31 May
      • Re: Need help querying a database of polynomialsPooly31 May
      • Re: Need help querying a database of polynomialsMichael Stassen1 Jun
  • Re: name 'Szczech' returns more rows then 'Szczec%'sheeri kritzer31 May
    • Re: name 'Szczech' returns more rows then 'Szczec%'Lukasz Budnik31 May
      • Re: name 'Szczech' returns more rows then 'Szczec%'Jake Peavy1 Jun
        • Re: name 'Szczech' returns more rows then 'Szczec%'Brendan Bouffler1 Jun
          • Re: name 'Szczech' returns more rows then 'Szczec%'Lukasz Budnik1 Jun
            • Re: name 'Szczech' returns more rows then 'Szczec%'Jake Peavy1 Jun
  • Re: name 'Szczech' returns more rows then 'Szczec%'Remo Tex1 Jun
    • Re: name 'Szczech' returns more rows then 'Szczec%'Lukasz Budnik1 Jun
      • Re: name 'Szczech' returns more rows then 'Szczec%'Remo Tex1 Jun
        • Re: name 'Szczech' returns more rows then 'Szczec%'Lukasz Budnik1 Jun
        • myisamchk (was: name 'Szczech' returns more rows then 'Szczec%')Chris Sansom4 Jun
          • Re: myisamchk (was: name 'Szczech' returns more rows then'Szczec%')Chris Sansom5 Jun
          • Re: myisamchk (was: name 'Szczech' returns more rows then 'Szczec%')gclark5 Jun
            • Re: myisamchk (was: name 'Szczech' returns more rows then 'Szczec%')Chris Sansom8 Jun