Re-writing MySQl query for execute faster

Try to cut the query in smaller parts, using temporary tables. Having sub queries is always time, memory and cpu consuming.
That should do the trick.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)