Quote:
Originally posted by mkkmg
not real sure what you are asking, not sure why you have the sum in there, that will not work.
((SUM(table1.fieldx = table2.fieldy))=1)
write out what you are after, such as if x = y then sum the results from both fields, well then why do you have it equal to 1.
Just explain better so I can help.
|
Thanks for your reply mkkmg, I appreciate your time.
What I'm trying to achieve is a boolean test for a value in say 'table1 col1 row X' against 'multiple (all) rows in table 2 col1'.
eg.
***********
Table 1
Col1
3
***********
Table 2
Col1
2
4
8
5
9
3
2
***********
My thought was that I could you the sum function to return a value (0/1) based on whether there was a match, and use that in a where clause to exclude/include a given record.
Hope this illustrates my problem, if its not painfully obvious already, I don't have much experience with tsql! (I have an uncomfortable feeling I've overlooked an obvious way to solve this problem

)
Thanks again for your time,
Cheers Casey.