从DB搜索电话号码 [英] Searching a phone number from DB

查看:70
本文介绍了从DB搜索电话号码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我想执行查询并从int数据类型表的列中获取电话号码。



例如,

我的表名是Contacts,字段是Name(var char)和Number(big int)。



< b>如果输入查询的输入为4567,那么它应该获取包含上述输入数字的数字(如野生字符)。



i googled但它无法得到解决方案。我们可以使用野生字符作为字符串数据类型,但不能使用数字或int类型。



从联系人中选择数字 Number = ______



现在我需要查询条件。



谢谢提前。

Hi,
I want to execute a query and fetch phone numbers from a column of a table of int data type.

For example,
My table name is Contacts and the fields are say Name(var char) and Number(big int).

if enter the input to the query as 4567 then it should fetch the numbers which contain the above entered numbers (like wild characters).

i googled it but couldn''t get the solution. We can use the wild characters for the string datatypes but not for the number or int type.

Select Number from Contacts where Number=______

Now i require the condition for the query.

Thank you in advance.

推荐答案

这样......

this way...
Select Number from Contacts where convert(varchar,Number) like '%4567%'



快乐编码!

:)


Happy Coding!
:)


这篇关于从DB搜索电话号码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆