Hi i am using PHPMYAdmin MYSQL in godaddy-vps server while using it i am getting an error when executing my SQL Query
I want total count of likes.post_id in likes table based on posts.user_id=2 posts list, by joining two table by likes.post_id=posts.id where likes_status=’true’
SELECT likes.post_id, likes.like_status, P.id, P.user_id,
count(*) AS likeCountProfilePosts FROM likes
INNER JOIN posts AS P ON P.id=likes.post_id
WHERE P.id IN (SELECT id FROM posts WHERE posts.user_id =2)
AND likes.like_status='true'
Getting error :
#1140 – In aggregated query without GROUP BY, expression #1 of SELECT list contains nonaggregated column ‘howtags_social_db.likes.post_id’; this is incompatible with sql_mode=only_full_group_by
If anyone know the solution please tell me
2
Answers
I just updated my SQL query and its working fine for me instead of changing PHPMyAdmin settings
Try this,
1. Open godaddy panel
2. Open phpmyadmin
3. Open Variable Setting