Please help- sorting and organizing data

R

ram8595

Ost Ocity Dstate Dcity price
A B C D 34
A B E F 45
X C L Y 78
X C M S 87
T O A B 98
Q W A B 86


Ost and Ocity go together. for example A B is the origin in first
two rows and A B is the destn in last two rows- I want to sort this
data in a report or a query such that the origin and dest are next
to one another i.e in this example the first two rows( A B as origin)
are next to last two rows( A B as destn) . The last two rows should be
3rd and 4 th row and also i want to add a summary row after the first
four rows. There are 100 s of such rows in my table. How to sort it
and summarize it

Please help thanks
 
A

akphidelt

So can you give me an example of what you want it to look like after the
sort. I didn't fully understand what you are trying to accomplish

Do you want it as

A B 34
A B 45
A B 98
A B 86

OR

A B C D 34
A B E F 45
T O A B 98
Q W A B 86

?
 
R

ram8595

So can you give me an example of what you want it to look like after the
sort. I didn't fully understand what you are trying to accomplish

Do you want it as

A  B  34
A  B  45
A  B  98
A  B  86

OR

A  B  C  D  34
A  B  E  F  45
T  O A  B  98
Q W A  B  86

?







- Show quoted text -

The second one that you mentioned- there are many records like that i
mentioned. how to get the second format that you mentioned.thanks
 

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

sorting 1
complex sorting query 3
Query combining the tables 15
sort a table uniquely 9
Tranportation query - interesting one 1
deleting duplicates but with a condition 5
Pls help with SQL query 12
Query needed 3

Top