Chapter 4 QUERYING AND MODIFYING DATA 225 Sometimes
Sunday, May 24th, 2009Chapter 4 QUERYING AND MODIFYING DATA 225 Sometimes data is entered into a database with leading or trailing spaces. To retrieve data free of these spaces, use the trim functions: LTRIM and RTRIM. SELECT RTRIM (LTRIM( this is an example ))+ TESTER As example Concatenation processes are often performed to generate names from a fully normalized database, as shown in Figure 4.5. You can change the direction of text or make an expression uppercase or lowercase by using these three functions: REVERSE, UPPER, and LOWER. Look at the following example: SELECT UPPER( mustafa ), LOWER( MUNAWAR ), REVERSE( Mustafa ) Concatenation of a string value to a NULL string results in NULL. A check should be performed for string content in situations where concatenated information could be partially or completely NULL. The SUBSTRING Function It may be that you want to return a part of a string rather than the whole string. The SUBSTRING function, which returns a part of a character or binary string, can be used for this. The syntax for SUBSTRING is SUBSTRING (expression, start, length) FIGURE 4.5 Concatenation to formulate names from multiple columns.
For high quality jboss hosting services please check jboss web hosting website.