Self-join - compare empty strings



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?

.



Relevant Pages

  • Re: Combine Tables
    ... Tbl1 is single field: ... Tbl2 has 2 fields: ... that determines where, the dash is. ... THEN use the query and tbl2 to create another query that joins ...
    (comp.databases.ms-access)
  • Re: Link table alternative
    ... If your query is an actual query & not an example: ... SELECT phsmgr, phscde, SUMAs Total ... The subquery in the SELECT clause will return a record for each phscde ... in tbl1, ...
    (microsoft.public.access.queries)
  • Re: Find and Replace against set of rules in 2nd table
    ... is a table of instructions for updating each Record of TBL1? ... > be a query so that I can run it as needed. ...
    (comp.databases.ms-access)
  • Re: Deleting Unmatched records
    ... I have created an unmatching query, using the wizard, on tbl2 with ... comparison to tbl1 to filter out which records in tbl1 no longer ... SQL View of query: ... PRIMARY KEY (Key1) ...
    (microsoft.public.access.queries)
  • Re: Find and Replace against set of rules in 2nd table
    ... Now I want to perform the following query: ... DELETE FROM Tbl1 ... >>Mari Johnson ... >>Jerry Straight ...
    (microsoft.public.access.queries)