February 16, 2007 at 4:36 am
I have 3 columns in a large database, all containing telephone numbers. I need to highlight the records where the same value appears in for example, Column 1 AND Column 2.
Any help would be appreciated.
Tony Harrison
February 16, 2007 at 6:49 am
Something like this?
Select Phone1, Phone2, Phone3 from Table
where Phone1 = Phone 2
or Phone1 = Phone3
or Phone2 = Phone3
February 16, 2007 at 6:54 am
Thanks very much. I have tried this, but the problem is that the fields which currently contain no number and are blank, are matching with each other!
Is there a way of stopping this from happening?
Yours confusingly,
T Harrison
February 16, 2007 at 7:14 am
add that condition to the where clause:
select
Select Phone1, Phone2, Phone3 from Table
where (Phone1 = Phone 2
or Phone1 = Phone3
or Phone2 = Phone3)
and ltrim(rtrim(phone1)) <> ''
and ltrim(rtrim(phone2)) <> ''
and ltrim(rtrim(phone3)) <> ''
February 16, 2007 at 8:59 am
That's great, thanks very much!
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply