Grid is not sorted correctly

Hi,
I’ve a grid with this:

select …
union
select…
order by idcontrol, idlinea

the query runs ok in the database getting the rows sorted properly, but when the grid runs, some records are not sorted, as follow:

image

others are ok:
image

any idea?

regards

Maybe you must change datatype to number for Linea field.

thanks.
they are already integer in the grid
image

You must set the clause ORDER BY TO END YOUR QUERY.
mysql> select id from UnionDemo1
→ union
→ select id from UnionDemo2
→ order by id desc;

Yes, the query is:

select …
union
select…
order by idcontrol, idlinea

is ok?

Yes. I think so the query must works.

The query works, and the results are sorted if I run it into the database, but not in the grid.
Additionally the records not sorted are random, two different users saw different results.

Maybe create a View on the data which contains your query with your Order By and then do your grid off the View.

Thanks gregsintx, I’m waiting for a response from support.