I am trying to choose the posts with highest likes or comments from a database. I want to include all options in case of a tie. I tried to use TOP 1 WITH TIES in MYSQL WORKBENCH but it does not give any value. What else can I try? The question goes like - List the post ID with the most number of likes. Display all such posts in case of a tie.
thanks.
Information is pretty thin, but it sounds like you should use the rank function, rank allows ties and you can filter on the result of the rank function.