mariadb SQL选择包含多个值的数组中的所有内容

xsuvu9jc  于 2022-11-08  发布在  其他
关注(0)|答案(1)|浏览(184)

我有一个包含20个值的数组,我想选择包含这些值的所有行,但我不知道如何操作。
以下是数组:

idList = ["tt11866324","tt1649418","tt12593682","tt4614584","tt10954984","tt6718412","tt10648342","tt1655389","tt10298810","tt14814040","tt1745960","tt8912936","tt7144666","tt6710474","tt9411972","tt12262116","tt3704428","tt7214954","tt8041270","tt16491324"]

我想选择的表称为“内容”。
有人能帮帮我吗?
更新:这是关于MariaDB,对不起。

whlutmcx

whlutmcx1#

您可以使用IN operator

SELECT *
FROM content
WHERE id IN ("tt11866324","tt1649418","tt12593682","tt4614584","tt10954984","tt6718412","tt10648342","tt1655389","tt10298810","tt14814040","tt1745960","tt8912936","tt7144666","tt6710474","tt9411972","tt12262116","tt3704428","tt7214954","tt8041270","tt16491324")

相关问题