如何从表中获取多个值
如何分割字符串值
我想获取id....
Table1
ID
001
002
003
查询
SELECT id FROM Table1 WHERE (id IN ('" & Eid & "'))
If Eid = 001 means It is displaying id 001
If Eid = 001, 002 means id is not displaying
如何进行查询以获取多个id。
需要查询帮助
How to split the String value
I want to get the id....
Table1
ID
001
002
003
Query
SELECT id FROM Table1 WHERE (id IN ('" & Eid & "'))
If Eid = 001 means It is displaying id 001
If Eid = 001, 002 means id is not displaying
How to make a query for getting multiple id.
Need Query Help
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
删除
'
引号:您的版本正在生成
,这意味着设置的括号内有一个 SINGLE 值。没有单引号:
括号内有 TWO 值。
但请注意,前导 0 可能会导致问题。它们可以被解释为八进制值,因此
009
将被解释为“十进制 10”。您可能需要预处理您的值才能将其转换为。
remove the
'
quotes:Your version was generating
which means there's a SINGLE value inside the set brackets. Without the single quotes:
you have TWO values in the set brackets.
However, note that the leading 0's may cause problems. They could be interepreted as octal values, so
009
would be interpreted as "10 decimal". You may have to pre-process your values to turn them intoinstead.
就像 Marc B 的答案,但我的解决方案更简单一些。
第一个替换是删除空格(如果没有空格,可以删除此替换)
第二个替换是将 , 替换为 ','
Like Marc B's answer but my solution is a bit easier.
First replace is removing space (if you have no space, you can remove this replace)
Second replace is replacing , to ','