Re: Using SELECT with EXISTS
From: Zach Wells (no_zwells_spam_at_ain1.com)
Date: 04/30/04
- Next message: Jacco Schalkwijk: "Re: truncate all tables"
- Previous message: Jeff Duncan: "Re: truncate all tables"
- In reply to: Anon: "Using SELECT with EXISTS"
- Next in thread: Jacco Schalkwijk: "Re: Using SELECT with EXISTS"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 30 Apr 2004 11:45:01 -0400
Anon wrote:
> I used to use
>
> IF NOT EXISTS ( SELECT 1 FROM Table WHERE col = 'x' ) BEGIN
> ....
> END
>
> I read in Ken Henderson's book that you should use SELECT * with EXISTS because the query optimizer will coose an effeciant plan for you. After years of SELECT 1 I'm thinking I should start using SELECT * with EXISTS. What is the recommended way thses days?
>
> Thanks in advance.
>
I don't think it really matters, but using * is a bit more standard I'd
guess.
Zach
- Next message: Jacco Schalkwijk: "Re: truncate all tables"
- Previous message: Jeff Duncan: "Re: truncate all tables"
- In reply to: Anon: "Using SELECT with EXISTS"
- Next in thread: Jacco Schalkwijk: "Re: Using SELECT with EXISTS"
- Messages sorted by: [ date ] [ thread ]