开发者

SQL Query with Multiple Or On Statement

I was wondering if there is a way to write a statement with multiple OR in a better way. For example if i want to Select the users with Username A,B,C,D,E,F,G. With the SQL i already know i will write something like this

Select * From Users Where Username="A" OR Username="B".....

But if i had more usernames it will be a difficult to read statement. I was wondering if there is a bet开发者_StackOverflow中文版ter way to write that: Something like:Username={"A","B"....} Thank you.


USE - IN

 Select * From Users Where Username IN ("A","B"..)


SELECT * FROM Users WHERE Username IN ('A','B'...);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜