GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing docs.voltdb.com — SIGN() Using VoltDBSIGN()SIGN() — Indicates whether a numeric value is positive, negative, or zero. SynopsisSIGN( numeric-expression ) DescriptionThe SIGN() function evaluates a numeric expression and returns +1 if it is positive, -1 if it is negative, and 0 or NULL if it is zero or null, respectively. For example: SIGN(3.1415) = 1 SIGN(5 - 12) = -1 SIGN(0) = 0 ExampleThe following example uses the SIGN() and DECODE() functions to select a graphical representation of the difference between two fields. In this case, up and down arrows based on the difference between the purchase price and current price of stocks. SELECT name, current_price,
DECODE(SIGN(Current_price - Purchase_price),
+1, CHAR(11014), -- Up arrow
-1, CHAR(11015), -- Down arrow
0, CHAR(8212)) -- M-dash
FROM Stocks
ORDER BY name ASC; |
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |