[RESOLVED] sql server 2000 - query to find same values in columns of same row
I am working with a database table called "zip". My guess is we bought it from a vendor. It contains cities, states, zip and longitude/latitude of the cities plus a lot of other data. There is a column called CITYSTNAME and another column called LL_CITY. I would like to run a query that finds out if these two values are always the same, so that if not, I can decide which is the better to use when I am looking up a city. My hope is they are not always the same - otherwise why have them? (My other hope is that I have been using the correct one all along).
Thanks.
Re: sql server 2000 - query to find same values in columns of same row
Is this what you are after?
Code:
SELECT CITYSTNAME, LL_CITY
FROM zip
WHERE CITYSTNAME <> LL_CITY
If they are always the same, it wont return any data.
Re: sql server 2000 - query to find same values in columns of same row
It didn't return any data.
Isn't that stupid? Why have two columns always containing the same value? There are 70,500 rows in the table.
Re: sql server 2000 - query to find same values in columns of same row
That is rather odd, presumably there was a reason for it... but it is likely to be one of those that you never find out.
Re: sql server 2000 - query to find same values in columns of same row
Quote:
Originally Posted by
si_the_geek
... it is likely to be one of those that you never find out.
I'll just add it to the heap!
Thanks, as always, for your help, Si.