i have 'topic' and 'comment' fields in table of database ,when some one give comment on topic no 1 ,it save in dabase with topic number and comment,
i want show topic number with higest comment.
tell me sql query to show result
ak47carbon
0
Newbie Poster
Recommended Answers
Jump to PostSELECT count(*) AS count, topic FROM comments GROUP BY topic ORDER BY count DESC LIMIT 1
All 3 Replies
pritaeas
2,194
¯\_(ツ)_/¯
Moderator
Featured Poster
ak47carbon
0
Newbie Poster
pritaeas
2,194
¯\_(ツ)_/¯
Moderator
Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.