Rick James Wrote:
-------------------------------------------------------
> Gag. EAV! One of the worst schemas around.
>
> Anyway, you need some self JOINs...
>
> > ( label = 6 AND properties IN (35,5) ) AND
> > ( label = 7 AND properties IN (7,8) )
>
> AND won't work; OR will
>
> > ( label = 6 AND properties IN (35,5) ) OR
> > ( label = 7 AND properties IN (7,8) )
>
> means something like "Phone that is WHITE OR GRAY
> _or_ it should have Simlock for Telering or
> Vodafone"
>
> If you want "Phone that is WHITE OR GRAY _and_ it
> should have Simlock for Telering or Vodafone",
> then you need two JOINs into Properties:
> SELECT ... FROM ...
> JOIN Properties color ON ...
> JOIN Properties slock ON ...
> WHERE
> color.label = 6 AND color.properties IN (35,5)
> AND
> slock.label = 7 AND slock.properties IN (7,8)
>
> Getting messy? Welcome to key-value schema!
> Here's my blog on the topic:
>
http://mysql.rjweb.org/doc.php/eav
I read that but Im still not able to get it work, Ive never worked with JOINS and i read couple of "tutorials and descriptions" but whatever I try, it's not working the only result I get is the same as before which isnt right, or syntax error..
What comes after the ON ? Or how is this build, I dont understand it how to make multiple JOINS, one I could make but how I do one in another one ?