I have these Attributes in a table ABC
Location, Zone, Sector, UnitNo
and want to write a query for them where Location and UnitNo are same but Sector is different
means I have sectors in different locations where UnitNo is same
I wrote this one but does not work.
select * from ABC A1 Inner JOIN ABC A2 on A1.Id = A2.ID
WHERE
A1.Sector <> A2.Sector AND A1.Location = A2.Location ANd A1.UnitNo = A2.UnitNo
please help.
Try this,