MySQL Forums :: Newbie :: write trim into INSERT and SELECT Queries


Advanced Search

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 Brian Conlan 02/14/2009 11:21AM
Re: write trim into INSERT and SELECT Queries Peter Brawley 02/14/2009 11:47AM
Re: write trim into INSERT and SELECT Queries Brian Conlan 02/14/2009 11:55AM
Re: write trim into INSERT and SELECT Queries Rick James 02/18/2009 09:03PM


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.