如何为多个记录编写SQL查询。 [英] How do I write the SQL query for multiple records.

查看:72
本文介绍了如何为多个记录编写SQL查询。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

以下查询检查特定列中是否存在值。



The following query checks whether value exist in particular columns or not.

Select * from ACCOUNT where 'UGEREA0000OE' in (MODIFYUSER,CREATEUSER)





然而这只适用于单一价值....我可以使用多种价值,即





however this is only working for single value....what can i use for multiple values i.e.

Select * from ACCOUNT where 'UGEREA0000OE','UGEREA0000OF' in (MODIFYUSER,CREATEUSER)





这不起作用。请让我知道我该怎么做。

谢谢。



This is not working. Please let me knw how can i do this.
Thanks.

推荐答案

你不能为SQL IN提供多个值 - 你只能在[IN关键字]的左侧指定一个列,而在右侧没有指定。

尝试:

You can't supply multiple values to an SQL IN - you can only specify a single column on the left [of the IN keyword], and none on the right.
Try:
SELECT * FROM Acount WHERE MuodifyUser IN ('UGEREA0000OE','UGEREA0000OF') OR CreateUser IN ('UGEREA0000OE','UGEREA0000OF')





错别字,和澄清 - OriginalGriff [/ edit]



[edit]Typos, and a clarifcation - OriginalGriff[/edit]


这篇关于如何为多个记录编写SQL查询。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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