MySQL Forums
Forum List  »  Newbie

Re: Query Assistance - Many to Many Join
Posted by: Rick James
Date: October 21, 2016 07:50PM

Would it work to change

CASE WHEN TOW.headers_question = 'AREA' THEN TOW.headers_value END 'Area' ,

to
( SELECT headers_value FROM outletdata
WHERE record_number = SEG.record_number AND headers_question = 'AREA' )
AS 'Area'

(and get rid of the JOIN TOW...)

Also add to outletdata:
INDEX(record_number, headers_question)

Ditto for OUTL and GPS.

Options: ReplyQuote


Subject
Written By
Posted
Re: Query Assistance - Many to Many Join
October 21, 2016 07:50PM


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.