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 wants a slightly
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
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
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
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
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
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
/21/04 at 9:48 PM -0600 wrote about: Sort Problem
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_ref_pts cannot
exceed
15.
Here is the current query which
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_ref_pts cannot exceed
15.
Here is the current query which obviously allows total_ref_pts to
exceed 15
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 :
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, district ASC
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
7 Paris
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 :
56 Paris 1
6 Paris 3
57 Paris 4
51 Paris 6
5 Paris 7
61 Paris 8
I have one table on my computer and one remote to my host on Internet.
I have this problem:
I use =
ALTER TABLE hotels1 DROP ID;
ALTER TABLE hotels1
AUTO_INCREMENT=1,
ADD ID int unsigned not null auto_increment default '0' first,
ADD primary key (ID);
to refresh the ID starting
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
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
Hi.
You cannot change the sorting behaviour of MySQL to achieve what you
want.
There are several possible work-arounds, though. One is to save the
numbers in a way (inserting zeros) that sorting will work, if that is
feasible:
5.10
5.13
5.02
5.02.08
5.03
5.27
If the depth (here: 3) of
17 matches
Mail list logo