How do i True Religion Outlet pull two rows from a mysql table that have one field value in common and the other field different
That is what it means.Did you try it?You get all rows that either are one or the other.If you are looking for rows that have all those features, you get nothing.Lets say you are looking for all people with blue and with green jackets, you would need to put in jacket=blue or jacket=green.That just how boolean logic works.If you put jacket=blue and jacket=green you look for persons that in one jacket have both colors. (Ok, that could be possible, but not with jackets that have only 1 color.So bad example)Nanne oct 25 at 16:32
Tim so you have to use subquery in this, if you use a query like this.
Select * from elements where user_id = 2 and Element_id in(8, 9)Having count(Element_id)= 2 will return you the first row and not two, so we have to use this query as subquery something like this.
Select * from elements where user_id in(Select user_id from elements where user_id= 2And element_id in(8, 9)Having count(Element_id)= 2)And element_id in(8, 9)
Maybe this is not the best way but should work and return you two rows with user_id = 2 only if has element_id of 8 and 9.Give it Cheap True Religion Jeans a try.Welling oct 25 at 17:50