where fieldA not equals fieldB

Ruslan Zasukhin sunshine at public.kherson.ua
Fri Jun 18 23:29:01 CDT 2004


On 6/18/04 7:35 PM, "Tim Davis" <timdavis at amug.org> wrote:

> Hi,
> 
> How do I structure a where sql condition to find where field a do not
> equal field b? I cannot get it to work at all.
> 
> Examples:
> 
> ... WHERE t1.fieldA <> t2.fieldB and t1.fieldC = t2.fieldD ...
> (this one claims an error in the expression)
> 
> or
> ... WHERE NOT t1.fieldA = t2.fieldB and t1.fieldC = t2.fieldD ...
> (this example ignores the "NOT" condition)


Try this
  
SELECT t1.*
FROM t1
WHERE 
     NOT t1.A IN (SELECT fldB FROM T1, T2 WHERE t1.fieldC = t2.fieldD


-- 
Best regards,
Ruslan Zasukhin      [ I feel the need...the need for speed ]
-------------------------------------------------------------
e-mail: ruslan at paradigmasoft.com
web: http://www.paradigmasoft.com

To subscribe to the Valentina mail list go to:
http://lists.macserve.net/mailman/listinfo/valentina
-------------------------------------------------------------



More information about the Valentina mailing list