shlomikalfa Posted November 10, 2007 Share Posted November 10, 2007 as the title mentioned i have an issue running a MySQL command, i want to make a search in my db for only but even one of the words in a certain collumn. - eg: DB: MyDB1 Collumn: Titles Titles-0: Heroes.Season2.Episode1 Titles-1: Heroes.Season2.Episode2 Titles-2: Heroes.Season2.Episode3 Titles-3: Prison-Break.Season3.EP4 i want the command to retrive any title which has the word "heroes" in it. Not working with these two: SELECT HIGH_PRIORITY * FROM downloads WHERE `downloads`.`Title` LIKE "heroes" SELECT HIGH_PRIORITY * FROM downloads WHERE `downloads`.`Title` = "heroes" Quote Link to comment Share on other sites More sharing options...
Daukan Posted November 10, 2007 Share Posted November 10, 2007 "SELECT * FROM downloads WHERE `downloads`.`Title` LIKE '%heroes%'"; The percentage signs tell the database to search for any match of the search word. Using both percent sings searches a match anywhere in the string Using one to left looks for words starting with the search string Quote Link to comment Share on other sites More sharing options...
rajivgonsalves Posted November 10, 2007 Share Posted November 10, 2007 why not just put SELECT HIGH_PRIORITY * FROM downloads WHERE `Title` LIKE '%heroes%' Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.