gpt4 book ai didi

mysql - 编写具有多个搜索功能的查询?

转载 作者:太空宇宙 更新时间:2023-11-03 11:00:34 24 4
gpt4 key购买 nike

我正在尝试创建一个查询,其中第一个查询将根据第一个查询的结果返回 COLUMN 第二个查询将执行:

SELECT OBJECT_ID from test.CORRELATION_SET
WHERE (NAME='STATUS' AND VALUE ='SUCCESS')
|OBJECT_ID|
|---------|
|A |
|B |
|C |
|---------|
SELECT * FROM test.CORRELATION_SET
WHERE OBJECT_ID = ('A'|'B'|'C');

最佳答案

查询如下

SELECT * FROM CORRELATION_SET
WHERE OBJECT_ID in (
SELECT OBJECT_ID from CORRELATION_SET
WHERE (NAME='STATUS' AND VALUE ='SUCCESS')
)

关于mysql - 编写具有多个搜索功能的查询?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16260064/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com