Self-join - compare empty strings
- From: arbitary <iamsonali@xxxxxxxxx>
- Date: Thu, 21 Jun 2007 19:06:59 -0000
Hi,
I have a query that self-joins a table and then compares a column.
Tbl1 has 3 columns - Id, Name and Address.
SELECT
a.Name,
a.Address
FROM
Tbl1 a,
Tbl1 b
WHERE
a.Id = b.Id
and
(
a.Name ! = b.Name
or a.Address!= b.Address
)
group by a.Name, a.Address
My problem is that if Name or Address is an empty string in any of the
rows, they are ignored in the comparison and the mismatch does not
show up in the result. I know that Sybase does this on purpose, but is
there a workaround?
.
- Follow-Ups:
- Re: Self-join - compare empty strings
- From: Rob Verschoor
- Re: Self-join - compare empty strings
- Prev by Date: Re: Getting ouput of system sp into temp table
- Next by Date: Re: Large list in select ... where ... in
- Previous by thread: Getting ouput of system sp into temp table
- Next by thread: Re: Self-join - compare empty strings
- Index(es):
Relevant Pages
|
|