开发者

I have a table with uuid and system column. I need a query to return only uuid's having system=1 but not the uuids with system= 1 nad 2

I have a table with uui开发者_运维知识库d and system column. I need a query to return only uuid's having system=1 but not the uuids with system= 1 and 2


SELECT  *
FROM    mytable m
WHERE   system = 1
        AND NOT EXISTS
        (
        SELECT  NULL
        FROM    mytable mi
        WHERE   mi.uuid = m.uuid
                AND mi.system = 2
        )
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜