Table Structure. To see more accurate table see the attachment:
Region
CountryCode
CityCode
Material
RepNo
RepRegionMIDSOUTH 106 458296 Iron 50002239 London Repository MIDSOUTH 106 458296 Iron 50085661 Spain Repository MIDSOUTH 106 608013 Iron 50002239 London Repository MIDSOUTH 106 608013 Iron 50085661 Spain Repository MIDSOUTH 106 950486 Iron 50002239 London Repository MIDSOUTH 106 950486 Iron 50085661 Spain Repository MIDSOUTH 111 458296 Iron 50002239 London Repository MIDSOUTH 111 458296 Iron 50085661 Spain Repository
I am trying to write a query which will list the duplicate value of CountryCode and CityCode
SELECT *
FROM Table1 s2
INNER JOIN Table1 s2
ON (s2.CountryCode = s1.CountryCode AND
s2.CityCode = s1.CityCode )
WHERE s1.RepNo <> s2.RepNo ;
this query ask me question to answer the city and country code.
i do not want to enter the data.
I want a query which will give me the listing from the table
for example: from the attach table the result should be
MIDSOUTH 106 458296 Iron 50002239 London Repository
MIDSOUTH 106 458296 Iron 50085661 Spain Repository
and than there should be next button, click which will take me to next dups record so for eg. if i click next it should show me:
MIDSOUTH 106 608013 Iron 50002239 London Repository
MIDSOUTH 106 608013 Iron 50085661 Spain Repository
Clicking Next should show me:
MIDSOUTH 106 950486 Iron 50002239 London Repository
MIDSOUTH 106 950486 Iron 50085661 Spain Repository
Clicking Next should show me:
MIDSOUTH 111 458296 Iron 50002239 London Repository
MIDSOUTH 111 458296 Iron 50085661 Spain Repository