List:General Discussion« Previous MessageNext Message »
From:Sinisa Milivojevic Date:November 28 2001 4:27pm
Subject:Re: INNER JOIN doesn't work correctly..
View as plain text  
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

Thread
importError with Python MySQLmodule.soErik Stewart27 Aug
  • INNER JOIN doesn't work correctly..Michael Widenius28 Nov
  • Re: INNER JOIN doesn't work correctly..Sinisa Milivojevic28 Nov