SQL

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/1/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
AND
second RECORD ONLY


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.
 
L

Lord Kelvan

please dont double post as i said in the other post i tested it on
that data you supplied and i got the second and third record so check
the queries and mae sure they are exatally how i supplied them

regards
Kelvan
 
S

subs

please dont double post as i said in the other post i tested it on
that data you supplied and i got the second and third record so check
the queries and mae sure they are exatally how i supplied them

regards
Kelvan

Kelvan

I tried yr query- but it is not working exactly as i need it- I need
to see in my final report all the records which have same dcity,
dstate, dzip, consignee, shipdate but have to have different
ozip,ocity, ostate.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Pls help with SQL query 12
SQL 1
deleting duplicates but with a condition 5
Query needed 4
Query combining the tables 15
report format 1
delete query wth a condition 1
Query Help 2

Top