Yahoo Poland Wyszukiwanie w Internecie

Search results

  1. 26 lip 2013 · You need to select one type or the other for the field, the field type can't vary by row. The simplest is to remove the ELSE '-' and let it implicitly get the value NULL instead for the second case.

  2. 15 mar 2013 · CASE LEN(ISNULL(last_Name,'')) WHEN 0 THEN '' ELSE ' ' + last_name END AS newlastName LEN(ISNULL(last_Name,'')) measures the number of characters in that column, which will be zero whether it's empty, or NULL, therefore WHEN 0 THEN will evaluate to true and return the '' as expected.

  3. 1 sie 2017 · I have a WHERE clause that I want to use a CASE expression in. However, my CASE expression needs to check if a field IS NULL. If the @UserRole variable value = 'Analyst', then the SupervisorApprovedBy column value must be NULL. Otherwise, I am saying return all data i.e. SupervisorApprovedBy = SupervisorApprovedBy.

  4. 11 lip 2012 · Yes - I did try CASE WHEN (ID IS NULL) THEN 'YES' ELSE 'NO' END AS ID_Value But I am looking for some other better approach something like IF(ID IS NULL, 'YES', 'NO') AS ID_Value in the Ms Sql, so that everything can be in a single line. Any suggestions please

  5. There are 3 possible ways to deal with nulls in expressions: using IsNull, Coalesce or CASE. I've explained these under separate headings below! The ISNULL Function. This function substitutes a given value when a column is null. The syntax is:

  6. 30 paź 2023 · SQL CASE statements coupled with IS NULL/IS NOT NULL checks provide a robust mechanism for handling NULL values in conditional business logic. To recap the key guidelines: Thoroughly check for possible NULLs in every branch of CASE statements. Avoid relying solely on ELSE/default cases to handle NULLs.

  7. I think this will solve the issue: UPDATE DeviceAttributeSET Details = CASE Name WHEN 'Accessories' THEN COALESCE(@Accessories, Details) WHEN 'Description' THEN COALESCE(@Description, Details) WHEN 'Specification' THEN COALESCE(@Specification, Details) ELSE Details ENDWHERE DeviceID = 10 ;

  1. Ludzie szukają również