MSDN > 論壇首頁 > Data Mining > Comparing a specification table to a results table
發問發問
 

問題Comparing a specification table to a results table

  • Tuesday, 30 June, 2009 9:26MartynCompton 使用者勳章使用者勳章使用者勳章使用者勳章使用者勳章
     
    I would like to know if there is a "simple" way to compare a specification table with a results tables contents.
    I have managed to do this in code by looping and capturing the name of the field for use in a repeating query but just maybe there is a simpler (and faster) way within the SQL language?
    I have stripped the table design down to it's bare bones below.
    The specification table has the fields - fieldName, Min, Max.  Each row in the table would have a fieldName and a min max for that fieldName
    The results table has the fields - Id, fieldNameA, fieldNameB, fieldNameC...etc. Each row has the sample id and then the results for the relevant fieldNameX.
    What I want to do is compare the results values against the specification table requirements.
    Any gurus with a suggestion on the most efficient way to do this?