How can I group this sql query? I want to print the records only 1 time …
LEFT JOIN users ON (friends.friend_adding_id = users.user_id OR friends.friend_added_id = users.user_id)
friend_adding_id = 1 OR friend_added_id = 1
AND friend_confirm = 1
ORDER BY friends.friend_id DESC
LIMIT 1, 10
The SQL GROUPBY clause is used in collaboration with the SELECT statement to arrange identical data into groups . This GROUP BY clause follows the WHERE clause in a SELECT statement and precedes the ORDER BY clause.