I have a problem when I get the data from the database, I get 4500 rows or more depending on the search and this data is distributed among 8 people trying to be fair.
This is the data I get:
The important column is codi_zona
since it keeps the code of different parts of the city (neighborhoods) and each person is given 2, 3 or 4 zones depending on the amount that goes out in the search for which I can not Give it to a person you have in your clients from different areas since it would not be possible for you to visit 20 places on the same day. That's why in the example above I show with this syntax ...
select nomb_terc , dire_refe , codi_zona , nuev_terr
from x8
order by codi_zona asc
... so that at the moment of generating the report the person is granted clients from the same area.
But my problem is that I can not give the same person the same data every month for which I consult if there will be a way to obtain the data in a random way, I mean:
Pepe - > codi_zona = 2, 5, 8 Mario - > codi_zona = 3,10,21
I work like this now:
Pepe - > codi_zona = 1, 2, 3 Mario - > codi_zona = 4,5,6
... and not in an orderly way as I am working.
I clarify that the zones are automatically, I do not place them manually according to the query. You can bring in a month some areas that were not seen last month.
I already tried with over (partition)
and there were no results. Is there any syntax in informix that can help me obtain such data, without mixing clients from different areas in the data of the people?