The following code sample illustrates the uses of ltrim and rtrim functions in SQL. Basically, ltrim function trims any spaces in the left of a string and rtrim trims in the right.
select * from CompanyDetails where LTRIM(RTRIM(REPLACE(company_name,' ','')))=LTRIM(RTRIM(REPLACE(@company_name,' ',''))) and country=@country and state=@state and LTRIM(RTRIM(REPLACE(city,' ','')))=LTRIM(RTRIM(REPLACE(@city,' ',''))) and category=@category
|
No responses found. Be the first to respond and make money from revenue sharing program.
|