# Query problem. (Max number when using minus)

**URL:** <https://forum.kirupa.com/t/query-problem-max-number-when-using-minus/269829>\
**Category:** programming\
**Created:** [September 2, 2008, 5:11am UTC](https://forum.kirupa.com/t/query-problem-max-number-when-using-minus/269829 "2008-09-02T05:11:28Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![DesignerMichael](https://avatars.discourse-cdn.com/v4/letter/d/898d66/32.png) [@DesignerMichael](https://forum.kirupa.com/u/DesignerMichael)\
**Post date:** [September 2, 2008, 5:11am UTC](https://forum.kirupa.com/t/query-problem-max-number-when-using-minus/269829/1 "2008-09-02T05:11:28Z")

</div>

How do you stop mysql from setting the number to an insanely high value when say doing… UPDATE users SET points=points-200 WHERE uid=182;

If the user has 100 points, points will be set to 29138389123 or whatever the max is for the field.

Is there a way to put an IF within the query? UPDATE users SET points=points-200 IF points\>=200 else points=0 WHERE uid=182???

Why exactly doesn’t mysql just zero out the field when that happens?
