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. 28 maj 2024 · Additionally, to achieve the same result in MySQL, we can use the ELT() function: SELECT student_id, course_id, ELT( CASE grade WHEN 'A+' THEN 1 WHEN 'A' THEN 2 WHEN 'B+' THEN 3 WHEN 'B' THEN 4 WHEN 'C' THEN 5 ELSE 6 END, 'SUPER', 'EXCELLENT', 'GOOD', 'SATISFACTORY', 'NEEDS IMPROVEMENT', 'POOR' ) AS grade_remarks FROM EXAM;

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

  6. mysql> SELECT INTERVAL(23, 1, 15, 17, 30, 44, 200); -> 3 mysql> SELECT INTERVAL(10, 1, 10, 100, 1000); -> 2 mysql> SELECT INTERVAL(22, 23, 30, 44, 200); -> 0; IS boolean_value. Tests a value against a boolean value, where boolean_value can be TRUE, FALSE, or UNKNOWN.

  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. More Examples. Example. Return 5 if the condition is TRUE, or 10 if the condition is FALSE: SELECT IF(500<1000, 5, 10);

  1. Ludzie szukają również