Most active user

A

Anonymous

Guest
ok i have a table which has entries of posts about music artists ...

the table looks something like :

ID | ARTIST | TITLE | AUTHOR | ALBUM | HITS | POST

well the author column has the name of the person who posted that

well i want to do is display who has posted the most .. like Craziest Poster : blablabla ....

i tried :
Code:
SELECT author, COUNT(*) AS top FROM table GROUP BY author ORDER BY top DESC

gives me an error .. any help would be apreciated :)
 
Hi!

Sorry, I will not fully answer your question (at least not yet).

First of all, if I were you and since it seems that you are at the beginning of your project, I would re-design my database: for instance, there might be several titles for a same artist and the way you have designed it will lead to redundancy... I would therefore create a table artist, then instead of putting the artist name, I would put an artist identifier in the table you described in your post. And it would allow to add also some extra information about each band...
Perhaps the same with author and album by the way.

Then, to help you, I guess that we need to know the error you got.

/Flood
 
good suggestion but this is a little temporary thing i am doing for a class project ..

i get this error :

Error in query: SELECT author, COUNT(*) AS top FROM table GROUP BY author ORDER BY top DESC; . You have an error in your SQL syntax near '; ' at line 1
 
Your syntax is correct. Check to make sure your spelling is correct and that the tables and fields actually exist.
 
stupid me .. i put the ';' before the " ... so that was messin u pma query .. thnx ppl :)
 
Back
Top