Yahoo Poland Wyszukiwanie w Internecie

Search results

  1. 8 gru 2016 · If I understand the question correctly, you want the equivalent of decode but in T-SQL. Select YourFieldAliasName = CASE PC_SL_LDGR_CODE WHEN '02' THEN 'DR' ELSE 'CR' END

  2. 23 kwi 2011 · In SQL Server the equivalent code is CASE statement. Here are the examples regarding how DECODE can be written in SQL Server. SELECT CASE WHEN Letters = 'First' THEN 1 WHEN Letters = 'Second' THEN 2 WHEN Letters = 'Third' THEN 3 ELSE 0 END AS LN FROM LettersTable

  3. Use SIGN(). It returns "0" for 0, "1" for positive and "-1" for negative values. SELECT DECODE( SIGN(money_return), 0, money_return, 1, money_return * 10, - 1, ABS(money_return) ) FROM CASH_T;

  4. www.sqltutorial.org › sql-comparison-functions › sql-decodeSQL DECODE - SQL Tutorial

    SELECT DECODE (3, 1, 'Equal 1,', 2, 'Equal 2', 'Not Equal 1 or 2'); Code language: SQL (Structured Query Language) (sql) This example works like the following IF-THEN-ELSEIF-ELSE statement: IF 3 = 1 THEN RETURN 'Equal 1'; ELSE IF 3 =2 THEN RETURN 'Equal 2'; ELSE RETURN 'Not Equal 1 or 2'; END IF ; Code language: SQL (Structured Query Language ...

  5. 2 cze 2015 · Here's a simplified example: DECLARE @T TABLE (id smallint identity, BitMask tinyint); INSERT INTO @T (BitMask) VALUES. (0), (1), (2), (3), (4), (5), (6), (7), (8), (9); SELECT. t.id, t.BitMask, bm.BitNum, bm.Permission. FROM @T t. OUTER APPLY ( SELECT * FROM (VALUES. (t.id, 0, 'Can X'), (t.id, 1, 'Can Y'), (t.id, 2, 'Can Z')

  6. 20 lis 2017 · Just swap out BASE64_COL_NAME for your column name, or you can replace sql:column("BASE64_COLUMN") with sql:variable("@base64variable") if you want to use a declared variable e.g. if you are making a function or something.

  7. DECODE allows you to compare a value to a set of possible values and return a corresponding result when a match is found. It is often used for data transformation, simplifying complex CASE statements, and providing concise value substitution based on specific conditions.

  1. Ludzie szukają również