MySQL Forums
Forum List  »  Newbie

Re: Query Performance of History Table
Posted by: Rick James
Date: November 27, 2014 09:19AM

To tack on the extra row (UNION) but avoid duplicating in case it is already in the list (DISTINCT):

( SELECT ...find the main rows... )
UNION DISTINCT
( SELECT ... FROM ticket_history where state_id in (1, 4, 10, 12, 13)
ORDER BY ID DESC LIMIT 1 );

Options: ReplyQuote


Subject
Written By
Posted
X Y
November 24, 2014 07:08AM
X Y
November 24, 2014 07:16AM
X Y
November 26, 2014 08:12AM
X Y
November 27, 2014 02:56AM
Re: Query Performance of History Table
November 27, 2014 09:19AM


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.