Results 1 to 4 of 4

Thread: int % reduction

  1. #1
    Join Date
    Nov 2016
    Posts
    3

    Unanswered: int % reduction

    Hello, could somebody correct my query please?

    I am trying to reduce the mob level in a given region by 60% using the following :-

    Code:
    UPDATE `mob`  SET Level = round(x*.4,0) WHERE 'Region' = 'said region';
    it returns no results although I have a matching region

    Thank you

  2. #2
    Join Date
    Oct 2007
    Posts
    52
    Provided Answers: 3
    what does the x* represent and what is the data type of the Level column?

  3. #3
    Join Date
    Nov 2016
    Posts
    3

    the column

    Quote Originally Posted by DNance View Post
    what does the x* represent and what is the data type of the Level column?


    The column in question is an int column. x represents the column name.

    I want to reduce everything in the x column by 50% but obviously only whole numbers.

    So a value of 14 would become 7, but what if a value is 1 or even 0 ?

    Is this best just done with /2 ?

    thanks

  4. #4
    Join Date
    Nov 2016
    Posts
    3
    Select FLOOR(Bonus1 / 2) as divided, Bonus1 as old

    From fixlaby.itemtemplate;


    Ok this gives the results I want

    Now I need to work out how to SET :-

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •