Yahoo Poland Wyszukiwanie w Internecie

Search results

  1. 29 lis 2019 · In MySQL you can use the COALESCE function: Returns the first non-NULL value in the list, or NULL if there are no non-NULL values. So you can simplify your query like this: SELECT * FROM table WHERE COALESCE(some_col, '') = '';

  2. 5 lip 2020 · You could also use COALESCE here to replace NULL with empty string, and then do the length comparison: SELECT * FROM test WHERE LENGTH(COALESCE(column1, '')) > 4;

  3. In MySQL, 0 or NULL means false and anything else means true. The default truth value from a boolean operation is 1. NULL instead of death <>. NULL. Two NULL values are regarded as equal in a GROUP BY. When doing an ORDER BY, NULL values are presented first if you do ORDER BY ... ASC and last if you do ORDER BY ...

  4. MySQL provides several useful functions that handle NULL effectively: IFNULL, COALESCE, and NULLIF. The IFNULL function accepts two parameters. The IFNULL function returns the first argument if it is not NULL , otherwise, it returns the second argument.

  5. 3 sie 2024 · This SQL query calculates the length of the string 'Hello World' after removing any leading and trailing whitespace. The TRIM () function removes the extra spaces, and the LENGTH () function returns the length of the resulting string. Output: LENGTH (TRIM (' Hello World '))| ---------------------------------+ 11|.

  6. 31 lip 2024 · We can insert NULL values into the columns that allow them: INSERT INTO employees (name, salary) VALUES ('Alice', NULL); INSERT INTO employees (name, salary) VALUES (NULL, 50000.00); Querying NULL Values. To handle NULL values in queries we must use specific SQL functions and operators.

  7. 25 kwi 2021 · The MySQL IFNULL() function is used to return a specified value if the expression is NULL. If the expression is not NULL, IFNULL() returns the expression. Syntax of MySQL ISNULL()

  1. Ludzie szukają również