Grid duplicated record when using render_sql

Hi all,
when i was using the render_table ($connector->render_table) works fine without any problem,the myGrid.toExcel method works and the mygrid.getRowsNum() return the correct row;

However, when i call the render_sql($connector->render_sql) it looks fine on the grid table (with 5 rows) but when i call the mygrid.toExcel, it duplicated 4 time of each row record(row = 20) and when i call the mygrid.getRowsNum() method it also return 20 in row count but i only have 5 record in my database and on the grid itself…
Thanks for your notice!

Can you share the problematic SQL ?

The problem can be caused by non-unique IDs in the result set, if your SQL query selects the same record multiple time it will be processed differently by the Grid and by the Export. Grid will ignore and will not render records with duplicate ids. The export will render ALL rows from dataset.

Thanks! it was the the sql statement which cause the problem.
solved :smiley: