|
 |
asp_databases thread: Toplist problems...
Message #1 by "Martin Johansson" <fjallsemester@h...> on Sun, 09 Feb 2003 17:37:03 +0000
|
|
Hi all!
Im currently using a table containing voteid, gameid, graphics, gameplay,
sound, overall. Every time a user votes a row is added. I know, its not the
best and fastest way of doing this, but since I dont have time to change
this, I will have to live with it. The vote scale is 0-10 and votes on all
games are stored in the same (this) table. Of course this makes it very
messy. However..
When I try to sort out those games for a top ten list, I try to use this SQL
string:
SQL = "SELECT gameid FROM Rank GROUP BY gameid ORDER BY avg(overall)
DESC,avg(graphics) DESC,avg(sound) DESC,avg(gameplay) DESC"
But, unfortunately, this wont work as its suppose to, giving me the id
numbers of games which havent got a vote at all. How should I solve this? I
should probably do this another way, ah well.. any suggestions are very
welcome! Thanks in advance! Have a good day!
---
Martin Johansson
Squaremedia HB
_________________________________________________________________
MSN Motor: Köp & sälj din bil här http://motor.msn.se/bilsok/
Message #2 by Greg Griffiths <greg2@s...> on Sun, 09 Feb 2003 20:35:12 +0000
|
|
You need to investigate the WHERE clause of a SELECT statement, this adds
the 'filter' stuff to your query.
At 17:37 09/02/03 +0000, you wrote:
>Hi all!
>
>Im currently using a table containing voteid, gameid, graphics, gameplay,
>sound, overall. Every time a user votes a row is added. I know, its not
>the best and fastest way of doing this, but since I dont have time to
>change this, I will have to live with it. The vote scale is 0-10 and votes
>on all games are stored in the same (this) table. Of course this makes it
>very messy. However..
>
>When I try to sort out those games for a top ten list, I try to use this
>SQL string:
>
>SQL =3D "SELECT gameid FROM Rank GROUP BY gameid ORDER BY avg(overall)
>DESC,avg(graphics) DESC,avg(sound) DESC,avg(gameplay) DESC"
>
>But, unfortunately, this wont work as its suppose to, giving me the id
>numbers of games which havent got a vote at all. How should I solve this?
>I should probably do this another way, ah well.. any suggestions are very
>welcome! Thanks in advance! Have a good day!
>---
>Martin Johansson
>Squaremedia HB
>
>
>_________________________________________________________________
>MSN Motor: K=F6p & s=E4lj din bil h=E4r http://motor.msn.se/bilsok/
>
>
>---
>Change your mail options at http://p2p.wrox.com/manager.asp or to
>unsubscribe send a blank email to
Message #3 by "Martin Johansson" <fjallsemester@h...> on Mon, 10 Feb 2003 18:18:49 +0000
|
|
Yeah, well I very well know the where clause.. =) Ah yeah, right I could use
that in some way there.. But how? I will have to think about that..
However.. thanks a lot! If someone would like to gimmie some support on how
I should use the where clause I'd really apperciate that. Thanks! Have a
good day!
>From: Greg Griffiths <greg2@s...>
>Reply-To: "ASP Databases" <asp_databases@p...>
>To: "ASP Databases" <asp_databases@p...>
>Subject: [asp_databases] Re: Toplist problems...
>Date: Sun, 09 Feb 2003 20:35:12 +0000
>
>You need to investigate the WHERE clause of a SELECT statement, this adds
>the 'filter' stuff to your query.
>
>At 17:37 09/02/03 +0000, you wrote:
>>Hi all!
>>
>>Im currently using a table containing voteid, gameid, graphics, gameplay,
>>sound, overall. Every time a user votes a row is added. I know, its not
>>the best and fastest way of doing this, but since I dont have time to
>>change this, I will have to live with it. The vote scale is 0-10 and votes
>>on all games are stored in the same (this) table. Of course this makes it
>>very messy. However..
>>
>>When I try to sort out those games for a top ten list, I try to use this
>>SQL string:
>>
>>SQL = "SELECT gameid FROM Rank GROUP BY gameid ORDER BY avg(overall)
>>DESC,avg(graphics) DESC,avg(sound) DESC,avg(gameplay) DESC"
>>
>>But, unfortunately, this wont work as its suppose to, giving me the id
>>numbers of games which havent got a vote at all. How should I solve this?
>>I should probably do this another way, ah well.. any suggestions are very
>>welcome! Thanks in advance! Have a good day!
>>---
>>Martin Johansson
>>Squaremedia HB
>>
>>
>>_________________________________________________________________
>>MSN Motor: Köp & sälj din bil här http://motor.msn.se/bilsok/
>>
>>
>>---
>>Change your mail options at http://p2p.wrox.com/manager.asp or to
>>unsubscribe send a blank email to
>
>
>
>
_________________________________________________________________
MSN Motor: Allt för den motorintresserade http://motor.msn.se/
Message #4 by "Meinken, Joe" <Joe.Meinken@q...> on Mon, 10 Feb 2003 12:25:34 -0600
|
|
You could try using the HAVING clause: i.e.
GROUP BY ...
HAVING avg(overall) > 0
-----Original Message-----
From: Martin Johansson [mailto:fjallsemester@h...]
Sent: Monday, February 10, 2003 12:19 PM
To: ASP Databases
Subject: [asp_databases] Re: Toplist problems...
Yeah, well I very well know the where clause.. =3D) Ah yeah, right I
could use
that in some way there.. But how? I will have to think about that..
However.. thanks a lot! If someone would like to gimmie some support on
how
I should use the where clause I'd really apperciate that. Thanks! Have
a
good day!
>From: Greg Griffiths <greg2@s...>
>Reply-To: "ASP Databases" <asp_databases@p...>
>To: "ASP Databases" <asp_databases@p...>
>Subject: [asp_databases] Re: Toplist problems...
>Date: Sun, 09 Feb 2003 20:35:12 +0000
>
>You need to investigate the WHERE clause of a SELECT statement, this
adds
>the 'filter' stuff to your query.
>
>At 17:37 09/02/03 +0000, you wrote:
>>Hi all!
>>
>>Im currently using a table containing voteid, gameid, graphics,
gameplay,
>>sound, overall. Every time a user votes a row is added. I know, its
not
>>the best and fastest way of doing this, but since I dont have time to
>>change this, I will have to live with it. The vote scale is 0-10 and
votes
>>on all games are stored in the same (this) table. Of course this
makes it
>>very messy. However..
>>
>>When I try to sort out those games for a top ten list, I try to use
this
>>SQL string:
>>
>>SQL =3D "SELECT gameid FROM Rank GROUP BY gameid ORDER BY
avg(overall)
>>DESC,avg(graphics) DESC,avg(sound) DESC,avg(gameplay) DESC"
>>
>>But, unfortunately, this wont work as its suppose to, giving me the
id
>>numbers of games which havent got a vote at all. How should I solve
this?
>>I should probably do this another way, ah well.. any suggestions are
very
>>welcome! Thanks in advance! Have a good day!
>>---
>>Martin Johansson
>>Squaremedia HB
>>
>>
>>_________________________________________________________________
>>MSN Motor: K=F6p & s=E4lj din bil h=E4r http://motor.msn.se/bilsok/
>>
>>
>>---
>>Change your mail options at http://p2p.wrox.com/manager.asp or to
>>unsubscribe send a blank email to
>
>
>
>
_________________________________________________________________
MSN Motor: Allt f=F6r den motorintresserade http://motor.msn.se/
Message #5 by "Martin Johansson" <fjallsemester@h...> on Tue, 11 Feb 2003 19:37:57 +0000
|
|
Thanks! I'll try that! :)
>From: "Meinken, Joe" <Joe.Meinken@q...>
>Reply-To: "ASP Databases" <asp_databases@p...>
>To: "ASP Databases" <asp_databases@p...>
>Subject: [asp_databases] Re: Toplist problems...
>Date: Mon, 10 Feb 2003 12:25:34 -0600
>
>You could try using the HAVING clause: i.e.
>GROUP BY ...
>HAVING avg(overall) > 0
>
>-----Original Message-----
>From: Martin Johansson [mailto:fjallsemester@h...]
>Sent: Monday, February 10, 2003 12:19 PM
>To: ASP Databases
>Subject: [asp_databases] Re: Toplist problems...
>
>
>Yeah, well I very well know the where clause.. =) Ah yeah, right I could
>use
>
>that in some way there.. But how? I will have to think about that..
>However.. thanks a lot! If someone would like to gimmie some support on how
>I should use the where clause I'd really apperciate that. Thanks! Have a
>good day!
>
>
> >From: Greg Griffiths <greg2@s...>
> >Reply-To: "ASP Databases" <asp_databases@p...>
> >To: "ASP Databases" <asp_databases@p...>
> >Subject: [asp_databases] Re: Toplist problems...
> >Date: Sun, 09 Feb 2003 20:35:12 +0000
> >
> >You need to investigate the WHERE clause of a SELECT statement, this adds
> >the 'filter' stuff to your query.
> >
> >At 17:37 09/02/03 +0000, you wrote:
> >>Hi all!
> >>
> >>Im currently using a table containing voteid, gameid, graphics,
>gameplay,
> >>sound, overall. Every time a user votes a row is added. I know, its not
> >>the best and fastest way of doing this, but since I dont have time to
> >>change this, I will have to live with it. The vote scale is 0-10 and
>votes
>
> >>on all games are stored in the same (this) table. Of course this makes
>it
> >>very messy. However..
> >>
> >>When I try to sort out those games for a top ten list, I try to use this
> >>SQL string:
> >>
> >>SQL = "SELECT gameid FROM Rank GROUP BY gameid ORDER BY avg(overall)
> >>DESC,avg(graphics) DESC,avg(sound) DESC,avg(gameplay) DESC"
> >>
> >>But, unfortunately, this wont work as its suppose to, giving me the id
> >>numbers of games which havent got a vote at all. How should I solve
>this?
> >>I should probably do this another way, ah well.. any suggestions are
>very
> >>welcome! Thanks in advance! Have a good day!
> >>---
> >>Martin Johansson
> >>Squaremedia HB
> >>
> >>
> >>_________________________________________________________________
> >>MSN Motor: Köp & sälj din bil här http://motor.msn.se/bilsok/
> >>
> >>
> >>---
> >>Change your mail options at http://p2p.wrox.com/manager.asp or to
> >>unsubscribe send a blank email to
> >
> >
> >
> >
>
>
>_________________________________________________________________
>MSN Motor: Allt för den motorintresserade http://motor.msn.se/
>
>
>
_________________________________________________________________
Senaste nytt från motormarknaden http://motor.msn.se/
|
|
 |