MySQL Forums
Forum List  »  Optimizer & Parser

Re: How to make this query faster? UNION + Inner Join
Posted by: Rick James
Date: May 16, 2009 11:02PM

Yes INNER JOIN exists.

Suggest adding parens to clarify, perhaps thus:
( SELECT
        id,
        titel,
        skaparnamn,
        datumtid,
        private
    FROM  titlar
)
UNION  ALL 
( SELECT
        trad.titelid AS id,
        titlar.titel,
        trad.skaparnamn,
        trad.datumtid,
        trad.private
    FROM  trad
    INNER JOIN  titlar ON titlar.id = trad.titelid
)
ORDER BY  `datumtid` DESC
LIMIT  1 

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: How to make this query faster? UNION + Inner Join
4109
May 16, 2009 11:02PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.