-
Can you post the table creation statement and rows insert ?
That may help to understand the problem.
Tamil
-
Originally Posted by LKBrwn_DBA
PS: Union all will make no difference unless routes are duplicate.
... other than eliminating an unneccessary sort of the data set, which I'd regard as being pretty important. UNION ALL ought to be the first recourse, and UNION should only be used where there is a specific requirement to make the result set distinct.
Do you roll your eyes at colleagues in meetings? Nice touch.
-
thanks...
but the order of the mon objects was changed -
e.g.
original:
mon1 mon2
mon2 mon3
mon3 mon5
mon5 mon2
mon2 mon1
--> after the union command:
mon1 mon2
mon2 mon1
mon2 mon3
mon3 mon5
mon5 mon2
--> but it's very important that the order is the same as the original, because afterwards some other activities are done.
-
Originally Posted by petzi74
thanks...
but the order of the mon objects was changed -
e.g.
original:
mon1 mon2
mon2 mon3
mon3 mon5
mon5 mon2
mon2 mon1
--> after the union command:
mon1 mon2
mon2 mon1
mon2 mon3
mon3 mon5
mon5 mon2
--> but it's very important that the order is the same as the original, because afterwards some other activities are done.
If you want order then mark each set of the result with a flag to indicate which column pair it came from -- ordering the result set by pair number would then be possible. Don't rely on the set being ordered without applying an ORDER BY.
-
How can I set a flag...
..sorry for that question...
-
Add a new column to each result set, with each one having a value like "Pair 1", "Pair 2", or just numerics of 1, 2, 3 etc
-
Thanks a lot for your help...
as usual...
Petra.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|