a row contains sometimes 4, sometimes 5, or 3, 6,7,8 values.
As mentioned above this is not because of a bad design.
A short explanation:
these values are just objects of different routes - some routes have only 3 monizoring objects, another 4, or 5...etc.
As soon as 1 route failed - every 10 minutes a token is send - the result is the route where the token has been failed.
Ok try this one (assuming there are no gaps (nulls) in the middle of route):
Select Id, Mon1, Mon2 From Mytable
Select Id, Mon2, Mon3 From Mytable
Where Mon3 Is Not Null
Select Id, Mon3, Mon4 From Mytable
Where Mon4 Is Not Null
Select Id, Mon4, Mon5 From Mytable
Where Mon5 Is Not Null
Order By 1,2,3;
PS: Union all will make no difference unless routes are duplicate.
"The person who says it cannot be done should not interrupt the person doing it." --Chinese Proverb