Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 [Match any Portion] - Possible in MSSQL?

Author  Topic 

ricoche
Starting Member

2 Posts

Posted - 2005-10-11 : 02:57:52
Hello,

I asked this question about mysql on another forum, but I would also like to know about MSSQL. I may need to switch to this platform if Mysql doesn't work. Here's my problem:

Instead of "match", I am looking for a "match any portion" way to do searches with mysql.

We have an mysql inventory database. We want to be able to put in 4984.600 and choose "match any portion" and it finds 4984600 which is in our database.

Does Mysql have a "match any portion" search function? In this case LIKE didn't work which we tried already.

Any ideas?

Thank you very much. This is a huge problem for us.

Jim

jen
Master Smack Fu Yak Hacker

4110 Posts

Posted - 2005-10-11 : 05:23:48
if you remove the "." during matching, you can still use like,
use replace to remove the "."

HTH

--------------------
keeping it simple...
Go to Top of Page

chiragkhabaria
Master Smack Fu Yak Hacker

1907 Posts

Posted - 2005-10-11 : 05:30:32
hmm..I guess there is no direct way to do this .. round about solution may work for you.. something like this

Select Select_Part From TableName Where Convert(Varchar(10),IntBAsedcolumns) Like Replace('%4984.600%','.','')

Complicated things can be done by simple thinking
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2005-10-11 : 05:43:37
Are you looking to just match either "4984.600" or "4984600" within the field? Or is "4.984600" also a match?

If you want "more sophisticated" regular expression matching then I would use the VB COM object from SQL (Dunno if that's an option with MySQL though, but I do know it can be done from MSSQL)

Kristen
Go to Top of Page
   

- Advertisement -