MySQL Forums
Forum List  »  PHP

Re: Problem with SQL query :(
Posted by: Rick James
Date: January 23, 2014 10:23AM

You don't get 10 because only the "a" side matches:
2 | 10 | 6 | 35 |

You get 11 because of these:
7 | 11 | 6 | 5 |
8 | 11 | 7 | 7 |

And 12:
12 | 12 | 6 | 5 |
13 | 12 | 7 | 8 |

You get 13 twice because of multiple matches on "7":
17 | 13 | 6 | 35 |
18 | 13 | 7 | 7 |
19 | 13 | 7 | 8 |

SELECT DISTINCT ...
would eliminate the duplicate.

What list do you want as the result?

> I want a Phone that is WHITE OR GRAY and it should have Simlock for Telering or Vodafone

That feels like what you are asking for. (Assuming "color" is 6 and "simlock" is 7.) #10 is GRAY, but does not have either kind of Simlock.

> And with more like properties IN ( 1,2,3,4,5 ) ??
An IN list can have any number of values (at least 1).

Options: ReplyQuote


Subject
Written By
Posted
January 18, 2014 10:39PM
January 19, 2014 12:30PM
January 19, 2014 12:41PM
January 20, 2014 03:24PM
January 21, 2014 06:22PM
January 22, 2014 04:19PM
January 23, 2014 12:15AM
Re: Problem with SQL query :(
January 23, 2014 10:23AM
January 19, 2014 12:33PM


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.