On Sep 15, 2006, at 12:56 PM, Chris W wrote:
Albert Padley wrote:
I have the following query that has worked fine for displaying
standings for a soccer league.
SELECT * FROM standings WHERE division = 'BU10' AND pool = '1'
ORDER BY tpts DESC, spts DESC, w DESC, ga ASC, team_number ASC
Albert Padley wrote:
I have the following query that has worked fine for displaying
standings for a soccer league.
SELECT * FROM standings WHERE division = 'BU10' AND pool = '1' ORDER
BY tpts DESC, spts DESC, w DESC, ga ASC, team_number ASC
As I said, works fine. Now, however, the league
Juan,
Good question. ref_pts are given for completing referee assignments and
are tracked throughout the season and can exceed 15 for tracking
purposes. However, only a max of 15 total_ref_pts are used in
determining the standings. adust_ref_pts (up or down) are given by the
Referee Assignor fo
Jeff and Shawn,
Thanks for coming up with similar solutions. Jeff, I have used yours
because it was more complete. I wasn't aware of the Case statement in
mysql. I guess I still have a lot to learn.
Thanks again.
Albert
On Oct 22, 2004, at 10:10 AM, Jeff Burgoon wrote:
This will solve your probl
This will solve your problem and remove the need for the PHP correction.
SELECT lname, teamno, game_pts, sport_pts, ref_pts, adjust_ref_pts,
CASE
WHEN ref_pts + adjust_ref_pts > 15 THEN game_pts + 15
ELSE game_pts + ref_pts + adjust_ref_pts
END AS total_pts,
CASE
WHEN ref_pts + adjust_ref_pts > 15
try this. It won't be as fast but it will sort correctly:
SELECT lname, teamno, game_pts, sport_pts, ref_pts, adjust_ref_pts,
if ((ref_pts+adjust_ref_pts)>15 ,game_pts + 15, game_pts + ref_pts +
adjust_ref_pts) AS total_pts, (ref_pts +
adjust_ref_pts) AS total_ref_pts FROM points WHERE division
Nothing? Not even a "You're out of luck?"
Thanks.
Albert
On Oct 21, 2004, at 9:48 PM, Albert Padley wrote:
I've inherited a problem for a youth soccer league. Their standings
are computed by adding 3 columns (game_pts, ref_pts and
adjust_ref_pts) together. However, the sum of ref_pts plus
adjust
If your town field always uses the format "town number", you can do:
SELECT *
FROM town
ORDER BY substring(town,locate(' ',town))+0 ASC;
On Sat, 2003-02-08 at 11:40, Nicolas JOURDEN wrote:
> Hi,
>
> How can I fix an order by using numbers and letters ?
>
> Id Town
> 56 Paris 1
> 60 Paris 10
Nicolas,
> How can I fix an order by using numbers and letters ?
> Id Town
> 56 Paris 1
> 60 Paris 10
> 7 Paris 11
> I'd like to get :
> 56 Paris 1
> 6 Paris 3
> 57 Paris 4
> A this time I'm doing this sql syntax :
> SELECT *
> FROM town
> ORDER BY town ASC
SELECT * FROM town ORDER by town ASC, d
Store town numbers in another column.
[EMAIL PROTECTED] wrote:
Hi,
How can I fix an order by using numbers and letters ?
Id Town
56 Paris 1
60 Paris 10
7 Paris 11
262 Paris 12
8 Paris 13
16 Paris 14
22 Paris 15
6 Paris 3
57 Paris 4
51 Paris 6
5 Paris 7
61 Paris 8
59 Paris 9
I'd like to get :
Hi.
I am trying to create a SQL statement that sorts by a column that contains a mix
of numbers and periods, but it doesn't seem to work properly.
The statement I use is:
SELECT ItemNumber FROM Catalog ORDER BY ItemNumber
For instance, here is how the list was sorted:
5.2.8
5.2
5.3
5.13
5.10
11 matches
Mail list logo