PDA

View Full Version : Get the most frequent field


fana605
02-14-2005, 04:06 PM
Hello!
I have a database where I insert fields from a form. These fields are like: enterprise, adress, date of question, date of answer and question theme. I choose this "question theme" from a list box and they are always the same (arround 15). I now wanted to list the most frequent "question theme" of the month.
Does anybody have an idea?
Thanks

kenetix
02-15-2005, 01:11 PM
if question_theme is an integer value say everytime someone posts a question theme, it increases the count by 1 then you can list all rows order by question theme DESC

however if question_theme is text you could do a num_rows query where question_theme LIKE '%$yourpost%'

so it does a search for the most similar matches related to question theme