MySQL Forums
Forum List  »  Newbie

write trim into INSERT and SELECT Queries
Posted by: Brian Conlan
Date: February 14, 2009 11:21AM

Can anyone tell me how to write trim into INSERT and SELECT Queries

How would i add to this

SELECT master_info.master_id, FirstName, SurName, Business_Name, coveredmaster_info.Covered_id, covered.Covered
FROM master_info
JOIN coveredmaster_info ON master_info.master_id = coveredmaster_info.master_id
JOIN covered ON coveredmaster_info.covered_id = covered.Covered_id
WHERE coveredmaster_info.covered_id='varWhere'
AND master_info.Business_Name LIKE'%Name%'
OR (master_info.Business_Name LIKE'%Name%') // this is where the problem is
when the value %Name% is empty it returns all records. i think it is because of white space, i maybe wrong.

Options: ReplyQuote


Subject
Written By
Posted
write trim into INSERT and SELECT Queries
February 14, 2009 11:21AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.