SQL数据源和字符串比较 [英] Sql datasource and string comparison

查看:122
本文介绍了SQL数据源和字符串比较的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用sql数据源进行数据绑定.数据库的阶段列中包含许多信息.它还包含带有投诉的几个行.当该阶段值得投诉时,我想获得一些信息.我输入的代码是从表位置选择阶段(PHASE ="COMPLAINT"),但是它没有选择我想要的信息,而是在我运行时显示了一个空表.但是它接受一个I​​D_NUMBER进行比较,但不接受字符串.例如WHERE PHASE =1756.请问我能找到解决方案吗.

I''m using sql datasource for databinding. The phase column in the data base has many information in it.it also contains sevral rows with complaint. I want to get some information when the phase is eual to complaint. The code I typed in was SELECT STAGE FROM TABLE WHERE (PHASE=''COMPLAINT'') but its not slecting the information i want instead it shows an empty table when i run. But its accepting a ID_NUMBER to compare but not string. for example WHERE PHASE= 1756. Can i get a solution please.

推荐答案

您的阶段列可能是阶段查找表的外键.如果您知道投诉"阶段的ID,则可以使用该ID.如果要使用字符串执行此操作,则必须加入父表.
Your phase column is likely a foreign key to a phase lookup table. If you know the id of the "Complaint" phase, then I would use that. If you want to do it using the string then you would have to join to the parent table.


这篇关于SQL数据源和字符串比较的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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