Re: Multiple tests against the same subquery.

From: Hugo Kornelis (hugo_at_pe_NO_rFact.in_SPAM_fo)
Date: 04/13/04

  • Next message: Eric: "Re: Multiple tests against the same subquery."
    Date: Tue, 13 Apr 2004 22:20:04 +0200
    
    

    On Tue, 13 Apr 2004 08:23:37 -0700, Eric wrote:

    >I'm only selecting the ID column because this whole query is actually a
    >subquery in yet another query. It works perfectly, I am extremely grateful
    >for your expertise!

    Eric,

    Glad I could be of assistance.

    Regarding the quote above - if it is a subquery with (NOT) IN, you
    don't need the DISTINCT. My guess is that removing distinct might
    improve performance (but with performance, the truth is alway in the
    testing); if it is a subquery with (NOT) EXISTS, you could also use
    SELECT * instead of SELECT <somecolumn>. I don't think it changes
    performance on this one, but it often does, so it's a good habit to
    always use SELECT * with (NOT) EXISTS.

    Best, Hugo

    -- 
    (Remove _NO_ and _SPAM_ to get my e-mail address)
    

  • Next message: Eric: "Re: Multiple tests against the same subquery."

    Relevant Pages

    • Re: Data type mismatch text to expression search
      ... I am trying to search a query where the field is actual an expression ... comprised of a subquery. ... I am getting a type mismatch error. ... (I usually use single quote double quote) ...
      (microsoft.public.access.formscoding)
    • Re: Update with subquery
      ... If you cut/pasted this then there is a " (double quote) in front of the word ... >I am trying to update a related table with a subquery. ... > TIA, ... > - Manish ...
      (microsoft.public.sqlserver.clients)
    • Re: Weird SQL
      ... A subquery in the *FROM clause* of a SELECT statement is also ... SELECT statement is also called a *nested subquery*. ... parent statement *any number of levels* above the subquery. ...
      (comp.databases.oracle.server)
    • Re: Data type mismatch text to expression search
      ... I am trying to search a query where the field is actual an expression ... comprised of a subquery. ... I am getting a type mismatch error. ... (I usually use single quote double quote) ...
      (microsoft.public.access.formscoding)