deleting var=0.1

2002-02-05 Thread Matthias Hoffmann

dear all.

I have a problem using mysql(occured at using phpMyAdmin):
i send the query:
DELETE FROM test WHERE user = test AND timestamp = 2002-02-05 21:42:53
AND var1=1000.1 LIMIT 1
and 0 effect.
but when var1 has a (INT) value there's no problem:
DELETE FROM test WHERE user = test AND timestamp = 2002-02-05 21:42:53
AND var1=1000 LIMIT 1
might there be a problem using such values?
has this error already occurded? I just joined this list

-Matthias Hoffmann


-
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




Re: deleting var=0.1

2002-02-05 Thread Dan Nelson

In the last episode (Feb 05), Matthias Hoffmann said:
 dear all.
 
 I have a problem using mysql(occured at using phpMyAdmin):
 i send the query:
 DELETE FROM test WHERE user = test AND timestamp = 2002-02-05 21:42:53
 AND var1=1000.1 LIMIT 1
 and 0 effect.
 but when var1 has a (INT) value there's no problem:
 DELETE FROM test WHERE user = test AND timestamp = 2002-02-05 21:42:53
 AND var1=1000 LIMIT 1
 might there be a problem using such values?
 has this error already occurded? I just joined this list

I assume var1 is a float in the first case?  Due to rounding issues,
the = operator will almost never work on fractions.  Use the primary
key to select which record to delete, or use a number range (var1
BETWEEN 1000.009 AND 1000.1001).

-- 
Dan Nelson
[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




Re: deleting var=0.1

2002-02-05 Thread Kyle Hayes

On Tuesday 05 February 2002 13:03, Matthias Hoffmann wrote:
 dear all.

 I have a problem using mysql(occured at using phpMyAdmin):
 i send the query:
 DELETE FROM test WHERE user = test AND timestamp = 2002-02-05
 21:42:53 AND var1=1000.1 LIMIT 1
 and 0 effect.
 but when var1 has a (INT) value there's no problem:
 DELETE FROM test WHERE user = test AND timestamp = 2002-02-05
 21:42:53 AND var1=1000 LIMIT 1
 might there be a problem using such values?
 has this error already occurded? I just joined this list

There was just a thread on this topic.  See the archives for the
thread with the title Problem with where clause on the 1st of 
February.

At the bottom of each e-mail on the list is a set of useful URLs
to things like the archives.

Best,
Kyle


-
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




Re: deleting var=0.1

2002-02-05 Thread Keith C. Ivey

On 5 Feb 2002, at 15:11, Dan Nelson wrote:

 I assume var1 is a float in the first case?  Due to rounding 
 issues, the = operator will almost never work on fractions.
 Use the primary key to select which record to delete, or use a 
 number range (var1 BETWEEN 1000.009 AND 1000.1001).

Matthias Hoffmann should also consider whether FLOAT is the right 
type.  The fact that he's trying to see whether the value is exactly 
equal to 1000.1 suggests that it's not, since floats aren't good for 
storing exact values.  If the column represents some sort of code, 
then a string type (like VARCHAR) is probably what he wants.  If it's 
a currency amount, then an integer type stored as the smallest unit 
(cents, for example) will work much better.

Fodder for the idiotic filter: sql,query

-- 
Keith C. Ivey [EMAIL PROTECTED]
Washington, DC

-
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