Which of these queries is more efficient?

Posted by Brian on Stack Overflow See other posts from Stack Overflow or by Brian
Published on 2010-05-28T17:22:13Z Indexed on 2010/05/28 17:31 UTC
Read the original article Hit count: 119

Filed under:
|
|
|
|

Which of these queries are more efficient?

select 1 as newAndClosed
    from sysibm.sysdummy1
    where exists (
        select 1 
            from items 
            where new = 1
        ) 
        and not exists (
            select 1 
                from status 
                where open = 1
        )


select 1 as newAndClosed
    from items
    where new = 1 
        and not exists (
            select 1 
                from status 
                where open = 1
        )

© Stack Overflow or respective owner

Related posts about sql

Related posts about database