: ORDER BY an ABSolute value
Did you try SQRT(id)? Should rank things the way you want if it's legal
(*_*)
-Original Message-
From: David Mackay [mailto:[EMAIL PROTECTED]]
Sent: Monday, February 11, 2002 7:08 PM
To: 'David Turner'; David Mackay
Cc: '[EMAIL PROTECTED]
David Turner'
Cc: [EMAIL PROTECTED]
Subject: RE: ORDER BY an ABSolute value
Did you try SQRT(id)? Should rank things the way you want if it's legal
(*_*)
-Original Message-
From: David Mackay [mailto:[EMAIL PROTECTED]]
Sent: Monday, February 11, 2002 7:08 PM
To: 'David Turn
Did you try SQRT(id)? Should rank things the way you want if it's legal
(*_*)
-Original Message-
From: David Mackay [mailto:[EMAIL PROTECTED]]
Sent: Monday, February 11, 2002 7:08 PM
To: 'David Turner'; David Mackay
Cc: '[EMAIL PROTECTED]'
Subject: RE: O
Thanks for your quick response Dave,
Have tried this, but no bannana...
I get:
"You have an error in your SQL syntax near 'abs(id)' at line 1"
Seems a not-valid thing to do these days...
Is there a work around?
Dave
from
Oz
> select id from table_name order by abs(id);
>
> Dave
>
>
> Dund
ilto:[EMAIL PROTECTED]]
> Sent: Tuesday, 12 February 2002 10:29
> To: David Mackay; 'David Turner'
> Cc: '[EMAIL PROTECTED]'
> Subject: RE: ORDER BY an ABSolute value
>
>
> At 10:08 +1000 2/12/02, David Mackay wrote:
> >Thanks for your quick response D
At 10:08 +1000 2/12/02, David Mackay wrote:
>Thanks for your quick response Dave,
>Have tried this, but no bannana...
>I get:
>"You have an error in your SQL syntax near 'abs(id)' at line 1"
If you can't put an expression in your ORDER BY, that means your version of
MySQL is older than 3.23. The
select id from table_name order by abs(id);
Dave
Dundee!
On Tue, Feb 12, 2002 at 09:46:25AM +1000, David Mackay wrote:
> G'Day folks,
>
>
> New to PHP/MySQL.
>
> Want to order the results of a SELECT by their 'absolute' value, not their
> sign.
> So regardless of whether it's +37 or -37,
G'Day folks,
New to PHP/MySQL.
Want to order the results of a SELECT by their 'absolute' value, not their
sign.
So regardless of whether it's +37 or -37, they are both 37 and thus both
come between 38 & 36, regardless of whether they're + or -.
eg.
100
-99
-92
91
72
-38
37
-37
etc...
I have
dear friends..
i'm doing a simple script that use mysql_fetch_array() and it give me the
following error.
Warning: Supplied argument is not a valid MySQL result resource in
/apache/htdocs/html/intranet.domus.cl/base.php on line 10
Warning: Supplied argument is not a valid MySQL result resource
David Turner'
Cc: [EMAIL PROTECTED]
Subject: RE: ORDER BY an ABSolute value
Did you try SQRT(id)? Should rank things the way you want if it's legal
(*_*)
-Original Message-
From: David Mackay [mailto:[EMAIL PROTECTED]]
Sent: Monday, February 11, 2002 7:08 PM
To: 'David Turn
Did you try SQRT(id)? Should rank things the way you want if it's legal
(*_*)
-Original Message-
From: David Mackay [mailto:[EMAIL PROTECTED]]
Sent: Monday, February 11, 2002 7:08 PM
To: 'David Turner'; David Mackay
Cc: '[EMAIL PROTECTED]'
Subject: RE: O
ilto:[EMAIL PROTECTED]]
> Sent: Tuesday, 12 February 2002 10:29
> To: David Mackay; 'David Turner'
> Cc: '[EMAIL PROTECTED]'
> Subject: RE: ORDER BY an ABSolute value
>
>
> At 10:08 +1000 2/12/02, David Mackay wrote:
> >Thanks for your quick response D
At 10:08 +1000 2/12/02, David Mackay wrote:
>Thanks for your quick response Dave,
>Have tried this, but no bannana...
>I get:
>"You have an error in your SQL syntax near 'abs(id)' at line 1"
If you can't put an expression in your ORDER BY, that means your version of
MySQL is older than 3.23. The
Paste your sql exactly as it is and your version of mysql.
Dave
On Tue, Feb 12, 2002 at 10:08:10AM +1000, David Mackay wrote:
> Thanks for your quick response Dave,
> Have tried this, but no bannana...
> I get:
> "You have an error in your SQL syntax near 'abs(id)' at line 1"
>
> Seems a not-val
14 matches
Mail list logo