Yahoo Poland Wyszukiwanie w Internecie

Search results

  1. 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)

  2. 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;

  3. For exact-value numbers, ROUND() uses the “ round half away from zero ” or “ round toward nearest ” rule: A value with a fractional part of .5 or greater is rounded up to the next integer if positive or down to the next integer if negative. (In other words, it is rounded away from zero.)

  4. 25 sty 2024 · The basic comparison operators in MySQL are used to compare two values. Here are the common ones: Equal to (=) Greater than (>) Less than (<) Greater than or equal to (>=) Less than or equal to (<=) Not equal to (<> or !=) Equal to (=) To check if two values are equal, we use the=operator.

  5. 28 maj 2024 · We can use it to perform conditional branching within the SELECT statement across various SQL databases, including SQL Server, MySQL, and PostgreSQL. Within SQL SELECT , we can use the WHEN-ELSE statement instead of the traditional IF-ELSE .

  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. 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:

  1. Ludzie szukają również