For testing purposes with original sql query please provide sql dump of database table resources (structure & data).
Thank you.
Active
1.3
Code