Click here to Skip to main content
15,915,093 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Can any one tell me about using LTrim and RTrim by writing a query in sqlserver, it would be very helpfull.

Actually I am bit confused using LTRIM and RTRIM conditions.

I would also want to get very good knowledge in using joins and conditions.
If there is any way to get perfect in joins and joining multiple tables with particular conditions, so that i can become thorough with it.

Thanks & Regards..
Posted
Updated 19-Jul-11 0:12am
v3

LTRIM(str): Removes all white spaces from the beginning of the string.
RTRIM(str): Removes all white spaces at the end of the string.
Example 1:
SELECT TRIM('   Sample   ');
Result: 'Sample'

Example 2:
SELECT LTRIM('   Sample   ');
Result: 'Sample   '

Example 3:
SELECT RTRIM('   Sample   ');
Result: '   Sample'
 
Share this answer
 
These link provide basic information.
http://msdn.microsoft.com/en-us/library/ms177827(v=sql.100).aspx[^]

http://msdn.microsoft.com/en-us/library/ms178660(v=sql.100).aspx[^]

Search Google you can find tons of articles that will be helpful to you.
 
Share this answer
 
LTRIM : Returns a character expression after removing leading blanks.

RTRIM : Returns a character string after truncating all trailing blanks.

I would start from http://www.w3schools.com/sql/sql_join.asp for learning about JOINS.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900