Dev0ps
1 year ago
345
3
Laravel

SQLSTATE[HY000]: General error: 3065 Expression #1 of ORDER BY clause is not in SELECT list, references column 'messages.created_at' which is not in SELECT list; this is incompatible with DISTINCT

Posted 1 year ago by Dev0ps

how to sove

$MsgChecker = Message::where('receiver_id', '!=', Auth::id())->where('user_id', '=', Auth::id())->select('user_id', 'receiver_id', 'conversation_token')->orderBy('created_at','asc')->distinct()->get();

Please sign in or create an account to participate in this conversation.