This shows you the differences between two versions of the page.
dev:sql:functions:concatenation [2009/12/04 22:53] tdo |
dev:sql:functions:concatenation [2016/06/28 22:38] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | {{page>:top_add&nofooter&noeditbtn}} | ||
- | <html><div align="center"><span style="color:red">DRAFT</span></div></html> | ||
- | ====== Omnidex SQL Function: CASE ====== | ||
- | {{page>:sql_bar&nofooter&noeditbtn}} | ||
- | ===== Description ===== | ||
- | The || (two vertical bars) function returns a single concatenated character string made up of two or more character strings. CHAR||CHAR will return a CHAR string; everything else will return a C STRING. | ||
- | All blanks are preserved during concatenation. Use the TRIM function to eliminate blanks if desired. | ||
- | ===== Syntax ===== | ||
- | [ < column_spec | "string" > || < column_spec | "string " > | ||
- | [ || <column_spec | "string "[...] ] | ||
- | |||
- | ===== Examples ===== | ||
- | ==== Example 1 ==== | ||
- | <code SQL> | ||
- | select company, | ||
- | CUSTOMERS.LASTNAME || ', ' || CUSTOMERS.FIRSTNAME | ||
- | from customers | ||
- | where company = 'systems' | ||
- | </code> | ||
- | ==== Example 2 ==== | ||
- | <code SQL> | ||
- | select | ||
- | PRODUCTS.PRODUCT_NO || ' is the product number for ' || PRODUCTS.DESCRIPTION | ||
- | from products | ||
- | </code> | ||
- | |||
- | {{page>:bottom_add&nofooter&noeditbtn}} |