Yahoo Poland Wyszukiwanie w Internecie

Search results

  1. You can use 'sign' with a decode. Sign will return -1 for any negative, 0 for 0, and 1 for any positive: select decode (sign (money_return), -1, abs (money_return), 1, money_return*10, money_return) from cash_t; edited Oct 7, 2019 at 14:04.

  2. 26 kwi 2016 · Simply use SIGN() in mysql It returns 1 as a positive value and -1 is a negative value. Example. SELECT SIGN(500); -- (Output is 1) SELECT SIGN(2500); -- (Output is 1) SELECT SIGN(-999); -- (Output is -1) SELECT SIGN(-5); -- (Output is -1)

  3. 28 wrz 2020 · SIGN() function in MySQL is used to return the sign of the given number. It returns 1 if the number is positive, -1 if the number is negative and 0 for zero. Syntax : SIGN(X) Parameter : SIGN() function accepts one parameter as input and will give you the results in values like Positive(+1),Negative(-1) and Zero(0).

  4. www.mysqltutorial.org › mysql-stored-procedure › mysql-if-statementMySQL IF Statement - MySQL Tutorial

    Use IF...THEN statement to conditionally execute a block of statements based on the evaluation of a specified condition. Use IF...THEN...ELSE statement to execute a block of statements if a specified condition is true and an alternative block of statements if the condition is false.

  5. Definition and Usage. The IF () function returns a value if a condition is TRUE, or another value if a condition is FALSE. Syntax. IF (condition, value_if_true, value_if_false) Parameter Values. Technical Details. Works in: From MySQL 4.0. More Examples. Example. Return 5 if the condition is TRUE, or 10 if the condition is FALSE:

  6. 19 paź 2018 · In MySQL, the SIGN() function returns the sign of a number. That is, it indicates whether or not the value is a positive number, a negative number, or zero. You provide the value as an argument when calling the function.

  7. 24 lut 2024 · To handle negative number rows effectively, we can use the ABS () function to convert negative numbers to positive numbers before using the MINUS operator. For example, the following query will return the expected result set: SELECT ABS(-5) AS num FROM dual. MINUS. SELECT ABS(-3) AS num FROM dual;

  1. Ludzie szukają również