I'm trying to get make my table get only 1 of the results that I have in the table. My table stores a posted_by column that allows more than 1 user to post more than once. So, my posted_by column has multiple of the username Chowderrunnah because that user has posted more than once. I only want to display one of the results so each user can be clicked on in the table instead of displaying many of the same user. (I'm trying to create a support ticket system if you're wondering why).
At the moment, my table is getting all the results from my table, even duplicates with the same posted_by (username). I only want it to display one result if there are more than 1 of the same posted by (username).
At the moment, my code is only the minimum -
SELECT * from support WHERE last_post_by != 'Admin'
The following Query fixed my problem :)
SELECT * from support WHERE last_post_by != 'Admin' GROUP BY posted_by
Using GROUP BY allowed me to only display one of the duplicate posted_by results.