Page 1 of 1

order by frequency in multiple columns

Posted: Wed Aug 11, 2010 6:49 pm
by cardi777
I have a table with 5 columns:
  • tag 1
    tag 2
    tag 3
    tag 4
    tag 5
If I want to show results ordered by the popularity(frequency) of those tags, what kind of query would i use?

Cheers,
Doug

Re: order by frequency in multiple columns

Posted: Wed Aug 11, 2010 7:06 pm
by josh
Suggestion: Normalize the table to make the query less difficult.

Re: order by frequency in multiple columns

Posted: Wed Aug 11, 2010 7:09 pm
by cardi777
josh wrote:Suggestion: Normalize the table to make the query less difficult.
When you say normalize, do you mean that i combine the keywords into 1 column? Unfortunately its not really an option

Re: order by frequency in multiple columns

Posted: Wed Aug 11, 2010 7:36 pm
by califdon
Lookup "normalize" in a relational database textbook or online.

Re: order by frequency in multiple columns

Posted: Wed Aug 11, 2010 11:36 pm
by cardi777
okay cool ill check that out