SQL select语句

hhh*_*112 0 sql select

在字符串数组中,我有一个可变数量的值.如果我想选择与数组变量相同的所有记录,sql语句将如何显示.

看起来像这样:

SELECT * FROM users WHERE username='"+ variable amount of elements in the String array like: Steven, Mike, John ..... +"'"
Run Code Online (Sandbox Code Playgroud)

Chr*_*rey 6

您可能正在寻找IN()运算符.

SELECT * FROM users WHERE username IN ('chris', 'bob', 'bill');