S
subs
ocity ost ozip dcity dstate dzip consignee shipdate
a b c d e f catsur 1/1/2008
h f g d e f catsurd 1/2/2008
p k l o z t cat 1/2/2008
l st mn d e f cat1 1/2/2008
otp ltp mtp dsc sto ppp cat2 2/3/2008
olm tma ots otaa iiiip ddddds sss 2/3/2008
l st mn d e f catsur 1/2/2008
I have the above data in a table called as p. The table has fields
like ocity, ost, ozip, dcity, dstate,dzip, consignee and shipdate.
I want to write a query which can extract all rows which has the SAME
dcity,dstate,dzip,consignee and shipdate but DIFFERENT ocity,ost and
ozip. For the consignee field, the query needs to check the first
six characters,- if they are same they are considered same or else
different. In the above example , the query should return the first,
second and the last record.
Can somebody pls help me with a SQL statement which can extract such
records , sorted such that we could see the result immediately.
Thanks- i will appreciate it.
a b c d e f catsur 1/1/2008
h f g d e f catsurd 1/2/2008
p k l o z t cat 1/2/2008
l st mn d e f cat1 1/2/2008
otp ltp mtp dsc sto ppp cat2 2/3/2008
olm tma ots otaa iiiip ddddds sss 2/3/2008
l st mn d e f catsur 1/2/2008
I have the above data in a table called as p. The table has fields
like ocity, ost, ozip, dcity, dstate,dzip, consignee and shipdate.
I want to write a query which can extract all rows which has the SAME
dcity,dstate,dzip,consignee and shipdate but DIFFERENT ocity,ost and
ozip. For the consignee field, the query needs to check the first
six characters,- if they are same they are considered same or else
different. In the above example , the query should return the first,
second and the last record.
Can somebody pls help me with a SQL statement which can extract such
records , sorted such that we could see the result immediately.
Thanks- i will appreciate it.