Comment faire pour résoudre les “clause ORDER BY n'est pas dans la liste SELECT” causé MySQL 5.7 SELECT DISTINCT et COMMANDE PAR

J'ai installé le nouveau Ubuntu et mon code a un problème avec MySQL.

( ! ) Warning: PDOStatement::execute(): SQLSTATE[HY000]: General error: 3065 
Expression #2 of ORDER BY clause is not in SELECT list, references column 'clicshopping_test_ui.p.products_date_added' which is not in SELECT list; this is incompatible with DISTINCT 
in /home/www//boutique/includes/OM/DbStatement.php on line 97s

Il semble MySQL 5.7 ne pas permettre à une requête du type:

select .... distinct with  order by rand(), p.products_date_added DESC

Si j'utilise ce cela fonctionne:

select distinct .... with  order by rand(), 

Comment faire pour résoudre cette situation ?

Ma requête SQL en PHP

 $Qproduct = $OSCOM_PDO->prepare('select distinct p.products_id,
            p.products_price
            from :table_products p left join :table_specials s on p.products_id = s.products_id
            where products_status = :products_status
            and products_view = :products_view
            and p.products_archive = :products_archive
            order by rand(),
            p.products_date_added DESC
            limit :products_limit');
                  $Qproduct->bindInt(':products_status', 1);
                  $Qproduct->bindInt(':products_view', 1);
                  $Qproduct->bindInt(':products_archive', 0);
                  $Qproduct->bindInt(':products_limit', 
                  (int)MODULE_FRONT_PAGE_NEW_PRODUCTS_MAX_DISPLAY);
utilisation group by au lieu de DISTINCTES
Désolé, je ne comprends pas, pourrait me montrer un exemple, parce que c'est deux la fonction select distinct .... et sélectionnez-la ........ groupe par

OriginalL'auteur kurama | 2016-04-24