Brian,

> > create table test(id int unsigned);
> > insert into test values(10);
> > select 15 - id from test;
> > The result is 18446744073709551611 instead of -5.

Trying to confirm this with MySQL 4.0.7 on a Win2K box:

mysql> create table test(id int unsigned);
Query OK, 0 rows affected (0.56 sec)

mysql> insert into test values(10);
Query OK, 1 row affected (0.08 sec)

mysql> select 15 - id from test;
+---------+
| 15 - id |
+---------+
|       5 |
+---------+
1 row in set (0.06 sec)

Now, once again with phpMyAdmin 2.3.3pl1:

SELECT 15 - id
FROM test LIMIT 0, 30
15 - id
5

But with the following statement (same with phpMyAdmin):

mysql> select 5 - id from test;
+----------------------+
| 5 - id               |
+----------------------+
| 18446744073709551611 |
+----------------------+
1 row in set (0.00 sec)

Check the "1" in your "15". Maybe there's something wrong.

Regards,
--
  Stefan Hinz <[EMAIL PROTECTED]>
  Geschäftsführer / CEO iConnect GmbH <http://iConnect.de>
  Heesestr. 6, 12169 Berlin (Germany)
  Tel: +49 30 7970948-0  Fax: +49 30 7970948-3

----- Original Message -----
From: "Brian Lindner" <[EMAIL PROTECTED]>
To: "Octavian Rasnita" <[EMAIL PROTECTED]>
Cc: "MySQL" <[EMAIL PROTECTED]>
Sent: Sunday, January 19, 2003 10:28 PM
Subject: Re: Substraction


> Octavian,
>
> Sunday, January 19, 2003, 7:31:57 AM, you wrote:
> > Hi all,
>
> > I've tried the following query:
>
> > create table test(id int unsigned);
> > insert into test values(10);
> > select 15 - id from test;
>
> > The result is 18446744073709551611 instead of -5.
>
> I ran this.. and it worked for me
>
> MySql 4.0.7 on Linux... ran it through phpMyAdmin
>
> > Am I doing something wrong?
>
> > Thank you.
>
> > Teddy,
> > Teddy's Center: http://teddy.fcc.ro/
> > Email: [EMAIL PROTECTED]
>
>
>
>
> ---------------------------------------------------------------------
> > Before posting, please check:
> >    http://www.mysql.com/manual.php   (the manual)
> >    http://lists.mysql.com/           (the list archive)
>
> > To request this thread, e-mail <[EMAIL PROTECTED]>
> > To unsubscribe, e-mail
<[EMAIL PROTECTED]>
> > Trouble unsubscribing? Try:
http://lists.mysql.com/php/unsubscribe.php
>
>
>
>
>
> --
>  Brian
>  Email: <[EMAIL PROTECTED]>
>
>
>
>
> ---------------------------------------------------------------------
> Before posting, please check:
>    http://www.mysql.com/manual.php   (the manual)
>    http://lists.mysql.com/           (the list archive)
>
> To request this thread, e-mail <[EMAIL PROTECTED]>
> To unsubscribe, e-mail
<[EMAIL PROTECTED]>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
>


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to