Sergey S. Kostyliov writes:
> >Description:
> Query with INNER JOIN return 0 rows, but the same query + yet another
> WHERE condition return 1 row
> >How-To-Repeat:
> Query:
> SELECT orders_common.vendor_id
> FROM orders_common
> INNER JOIN orders_common_count
> ON (orders_common.id=orders_common_count.orders_id)
> WHERE orders_common_count.clients_names_id in (3639)
> AND orders_common.vendor_id=95
> Result - 0 rows
> but,
> SELECT orders_common.vendor_id
> FROM orders_common
> INNER JOIN orders_common_count
> ON (orders_common.id=orders_common_count.orders_id)
> WHERE orders_common_count.clients_names_id in (3639)
> AND orders_common.vendor_id=95
> AND and orders_common.id=1060340
> Result - 1 row
You have two AND's one after another.
Try with one AND and tell us what you get ...
--
Regards,
__ ___ ___ ____ __
/ |/ /_ __/ __/ __ \/ / Mr. Sinisa Milivojevic <sinisa@stripped>
/ /|_/ / // /\ \/ /_/ / /__ MySQL AB, Fulltime Developer
/_/ /_/\_, /___/\___\_\___/ Larnaca, Cyprus
<___/ www.mysql.com