LEFT JOIN problem

2008-04-14 Thread Jerry Schwartz
I have a table, eo_name_table, that has exactly 860 unique titles in it. Each record also has a date field, eo_pub_date: +-+--+--+-+-+---+ | Field | Type | Null | Key | Default | Extra |

Re: LEFT JOIN problem

2008-04-14 Thread Bill Newton
Hi Jerry, I think the problem is that NULL is not less than or greater than your prod_published date. So you probably have eo_pub_date set to NULL in 56 of your rows. so for eo_name_table.eo_pub_date prod.prod_published or eo_name_table.eo_pub_date = prod.prod_published mysql will

RE: LEFT JOIN problem

2008-04-14 Thread Jerry Schwartz
From: Bill Newton [mailto:[EMAIL PROTECTED] Sent: Monday, April 14, 2008 2:09 PM To: Jerry Schwartz Cc: 'Mysql' Subject: Re: LEFT JOIN problem Hi Jerry, I think the problem is that NULL is not less than or greater than your prod_published date. So you probably have eo_pub_date set to NULL in 56

RE: LEFT JOIN problem

2008-04-14 Thread Jerry Schwartz
I've found yet another oddity with this situation. If I leave the date test off of both JOINs they give the same number of rows, but they give me the wrong number! Neither one of them gives me 860 rows returned. I must not understand how a LEFT JOIN works. By the way, the EXPLAIN for both of my

RE: LEFT JOIN problem

2008-04-14 Thread Jerry Schwartz
. Farmington, CT 06032 860.674.8796 / FAX: 860.674.8341 www.the-infoshop.com www.giiexpress.com www.etudes-marche.com -Original Message- From: Jerry Schwartz [mailto:[EMAIL PROTECTED] Sent: Monday, April 14, 2008 11:26 AM To: 'Mysql' Subject: LEFT JOIN problem I have a table, eo_name_table

Re: left join problem

2008-01-09 Thread Brent Baisley
Yes, that is the correct behavior of a LEFT JOIN. A left join keeps all the record from the original/left table and will link up any related data from the right table, but if there is no related data, it sets it to NULL. If you want the join to act as a filter, the just use regular JOIN.

left join problem

2008-01-08 Thread Wes Hegge
I am attempting to left join several tables. This was working at one time but has seemed to stop just recently. I have checked and installed the lastest version of mysql via Debian Etch apt-get. I am running version 5.0.32. I have simplified the example down to just 3 tables but the problem

Left join problem

2007-09-05 Thread Kaj Schermer Didriksen
Hi two tables gi_t and gi gi_t holds 5 records. gi holds ca. 1500. I need all from gi for each in gi_t ie LEFT JOIN!!! but this: SELECT gi.id AS id, overskrift,gidata FROM gi_t LEFT JOIN gi ON gi_t.id=gi.gitref WHERE bladref=137 gives the same as SELECT gi.id AS id, overskrift,gidata FROM

RE: Left join problem

2007-09-05 Thread Jerry Schwartz
[mailto:[EMAIL PROTECTED] Sent: Wednesday, September 05, 2007 10:39 AM To: mysql@lists.mysql.com Subject: Left join problem Hi two tables gi_t and gi gi_t holds 5 records. gi holds ca. 1500. I need all from gi for each in gi_t ie LEFT JOIN!!! but this: SELECT gi.id AS id, overskrift

Re: Left join problem

2007-09-05 Thread Martijn Tonies
Hi, two tables gi_t and gi gi_t holds 5 records. gi holds ca. 1500. I need all from gi for each in gi_t ie LEFT JOIN!!! but this: SELECT gi.id AS id, overskrift,gidata FROM gi_t LEFT JOIN gi ON gi_t.id=gi.gitref WHERE bladref=137 gives the same as SELECT gi.id AS id,

[5.0] Left Join Problem

2006-07-21 Thread Stephen P. Fracek, Jr.
I'm trying to upgrade from MySQL 4.1 to MySQL 5.0. A query that works in MySQL 4.1 does not work in MySQL 5.0 and I'm at a loss as to how to proceed. SELECT tab_a.item1, tab_b.item2, tab_c.item3, tab_d.item4, tab_e.item5, tab_f.item6 FROM db.tab_a, db.tab_e, db.tab_f LEFT JOIN db.tab_b ON

Re: [5.0] Left Join Problem

2006-07-21 Thread Paul DuBois
At 12:47 PM -0500 7/21/06, Stephen P. Fracek, Jr. wrote: I'm trying to upgrade from MySQL 4.1 to MySQL 5.0. A query that works in MySQL 4.1 does not work in MySQL 5.0 and I'm at a loss as to how to proceed. SELECT tab_a.item1, tab_b.item2, tab_c.item3, tab_d.item4, tab_e.item5, tab_f.item6

Re: [5.0] Left Join Problem

2006-07-21 Thread Gerald L. Clark
Stephen P. Fracek, Jr. wrote: I'm trying to upgrade from MySQL 4.1 to MySQL 5.0. A query that works in MySQL 4.1 does not work in MySQL 5.0 and I'm at a loss as to how to proceed. SELECT tab_a.item1, tab_b.item2, tab_c.item3, tab_d.item4, tab_e.item5, tab_f.item6 FROM db.tab_a, db.tab_e,

Re: [5.0] Left Join Problem

2006-07-21 Thread Stephen P. Fracek, Jr.
On 2006-07-21 1:01 PM, Gerald L. Clark [EMAIL PROTECTED] wrote: It is a join precedence issue. Use INNER Join instead of a comma. Thanks Gerald. Paul DuBois' polite suggestion to read the manual helped. Upon re-reading the section about the change in precedence with the comma operator and

LEFT JOIN problem

2005-11-05 Thread Guy Brom
I have the following tables: languages language_id int, language_title varchar(80) objects object_id int object_language_id int object_title varchar(100) I want to select ALL available languages, and match the translated object (if it is exists) for a specific object_id. If it does not exists

Re: LEFT JOIN problem

2005-11-05 Thread Pooly
2005/11/5, Guy Brom [EMAIL PROTECTED]: I have the following tables: languages language_id int, language_title varchar(80) objects object_id int object_language_id int object_title varchar(100) I want to select ALL available languages, and match the translated object (if it is

Re: LEFT JOIN problem

2005-11-05 Thread Rhino
PROTECTED] To: mysql@lists.mysql.com Sent: Saturday, November 05, 2005 10:28 AM Subject: LEFT JOIN problem I have the following tables: languages language_id int, language_title varchar(80) objects object_id int object_language_id int object_title varchar(100) I want to select ALL

Re: 4.0.18 - 4.1.7 LEFT JOIN problem

2004-11-23 Thread Sergei Golubchik
Hi! On Nov 22, Santino wrote: At 15:23 +0100 22-11-2004, Sergei Golubchik wrote: Hi! On Nov 22, Dilipan Sebastiampillai wrote: I moved a db from 4.0.18 to 4.1.7 and I realise that the SAME sql query using LEFT JOIN gives me different result. The result from 4.0.18 does s real LEFT JOIN

Re: 4.0.18 - 4.1.7 LEFT JOIN problem

2004-11-23 Thread Dilipan Sebastiampillai
Hi! On Nov 22, Dilipan Sebastiampillai wrote: I moved a db from 4.0.18 to 4.1.7 and I realise that the SAME sql query using LEFT JOIN gives me different result. The result from 4.0.18 does s real LEFT JOIN but 4.1.7 differs sometimes and I don't want that. I think it comes from an

Re: 4.0.18 - 4.1.7 LEFT JOIN problem

2004-11-23 Thread Sergei Golubchik
Hi! On Nov 23, Dilipan Sebastiampillai wrote: Hi! On Nov 22, Dilipan Sebastiampillai wrote: I moved a db from 4.0.18 to 4.1.7 and I realise that the SAME sql query using LEFT JOIN gives me different result. The result from 4.0.18 does s real LEFT JOIN but 4.1.7 differs

RE: 4.0.18 - 4.1.7 LEFT JOIN problem

2004-11-23 Thread Donny Simonton
: Tuesday, November 23, 2004 2:13 PM To: Dilipan Sebastiampillai Cc: [EMAIL PROTECTED] Subject: Re: 4.0.18 - 4.1.7 LEFT JOIN problem Hi! On Nov 23, Dilipan Sebastiampillai wrote: Hi! On Nov 22, Dilipan Sebastiampillai wrote: I moved a db from 4.0.18 to 4.1.7 and I realise

4.0.18 - 4.1.7 LEFT JOIN problem

2004-11-22 Thread Dilipan Sebastiampillai
I moved a db from 4.0.18 to 4.1.7 and I realise that the SAME sql query using LEFT JOIN gives me different result. The result from 4.0.18 does s real LEFT JOIN but 4.1.7 differs sometimes and I don't want that. I think it comes from an 'optimization' how can I make a query without using

Re: 4.0.18 - 4.1.7 LEFT JOIN problem

2004-11-22 Thread Sergei Golubchik
Hi! On Nov 22, Dilipan Sebastiampillai wrote: I moved a db from 4.0.18 to 4.1.7 and I realise that the SAME sql query using LEFT JOIN gives me different result. The result from 4.0.18 does s real LEFT JOIN but 4.1.7 differs sometimes and I don't want that. I think it comes from an

Re: 4.0.18 - 4.1.7 LEFT JOIN problem

2004-11-22 Thread Santino
At 15:23 +0100 22-11-2004, Sergei Golubchik wrote: Hi! On Nov 22, Dilipan Sebastiampillai wrote: I moved a db from 4.0.18 to 4.1.7 and I realise that the SAME sql query using LEFT JOIN gives me different result. The result from 4.0.18 does s real LEFT JOIN but 4.1.7 differs sometimes and I

Re: 4.0.18 - 4.1.7 LEFT JOIN problem

2004-11-22 Thread Jeff Smelser
On Monday 22 November 2004 04:15 pm, Santino wrote: I can confirm it anyway: I think we have a bug.. Unless someone else see something, might want to take this to bugs.mysql.com Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 578 to server version:

LEFT JOIN problem

2003-11-20 Thread Rory McKinley
Hi List I am currently running a query that reads records from one table (Table 1) links these records to an id value in another table (Table 2) and returns the result. The tables are as follows, with sample data: Table 1in DB 1: line_number | category_name | category_value | line_type 1

Re: LEFT JOIN problem

2003-11-20 Thread Roger Baklund
* Rory McKinley [...] SELECT a.line_number, a.category_value, IFNULL(b.parameter_trigger, 0) FROM DB1.Table 1 AS a LEFT JOIN DB2.Table 2 AS b ON a.category_name = b.parameter_value WHERE a.line_type = 13 AND b.parameter_ID = 13 The only problem is that the query only returns the first two

[SOLVED]Re: LEFT JOIN problem

2003-11-20 Thread Nobody
understand binary and those who don't (Unknown) - Original Message - From: Roger Baklund [EMAIL PROTECTED] To: [EMAIL PROTECTED] Cc: Rory McKinley [EMAIL PROTECTED] Sent: Thursday, November 20, 2003 4:23 PM Subject: Re: LEFT JOIN problem * Rory McKinley [...] SELECT a.line_number

Re: [SOLVED]Re: LEFT JOIN problem

2003-11-20 Thread Martijn Tonies
Thanks Roger That fixed the problem.I was under the impression that I only had to put the linked columns n the ON and everything else in the WHERElive an learn I guess. Ehm, I'm not completely sure, but isn't this invalid behaviour? Can you post the DDL and INSERT INTO data for

Re: [SOLVED]Re: LEFT JOIN problem

2003-11-20 Thread Roger Baklund
* Martijn Tonies * Rory McKinley Thanks Roger That fixed the problem.I was under the impression that I only had to put the linked columns n the ON and everything else in the WHERElive an learn I guess. Ehm, I'm not completely sure, but isn't this invalid behaviour? Huh? What

Re: [SOLVED]Re: LEFT JOIN problem

2003-11-20 Thread Martijn Tonies
* Martijn Tonies * Rory McKinley Thanks Roger That fixed the problem.I was under the impression that I only had to put the linked columns n the ON and everything else in the WHERElive an learn I guess. Ehm, I'm not completely sure, but isn't this invalid behaviour?

Re: [SOLVED]Re: LEFT JOIN problem

2003-11-20 Thread Martijn Tonies
* Martijn Tonies * Rory McKinley Thanks Roger That fixed the problem.I was under the impression that I only had to put the linked columns n the ON and everything else in the WHERElive an learn I guess. Ehm, I'm not completely sure, but isn't this invalid

Re: [SOLVED]Re: LEFT JOIN problem

2003-11-20 Thread Roger Baklund
* Martijn Tonies * me Huh? What would be invalid about it? That moving parts of the WHERE clause to the JOIN clause returns a different result set. But as I said: I don't have the full story ... oh wait, I found the first message in my mailbox somewhere. I guess OUTER is optional, and

MySQL Left Join Problem

2002-11-18 Thread Mark Colvin
I am having some problems seeing posts to the list so if anyone has already received this mail I apologise. Anyway, I have a two table query where I want to return records from the first table and if they have corresponding details in my second table I wish to return those as well. A sample sql

possible left join problem?

2002-09-27 Thread Matt MacDougall
Hi, I've got two tables, links and categories. links ... id int(11) NOT NULL auto_increment, name text, note text, link text, category1 int(11) NOT NULL default '0', category2 int(11) NOT NULL default '0', category3 int(11) NOT NULL default '0', date_added timestamp(14) NOT

LEFT JOIN problem.

2002-03-12 Thread Jon Barker
Hi All, I have a curious problem with a left join:- create table foo (a int); insert into foo values(1); insert into foo values(2); create table bar1 (a int, b datetime not null); insert into bar1 values(1, '25-12-2001'); create table bar2 (a int, b datetime); insert into bar2 values(1,

Left Join problem - Please Help

2002-02-15 Thread Miretsky, Anya
Whenever I try to issue a query which has a left join for two tables and a where clause for a column in the second table that is a varchar the query runs indefinitely. If I change the where clause to search on a numeric type column the query runs and returns expected values. Does anyone know

RE: Left Join problem - Please Help

2002-02-15 Thread Rick Emery
Show us your table structure, some table values and the SELECT statement that works and the one that doesn't -Original Message- From: Miretsky, Anya [mailto:[EMAIL PROTECTED]] Sent: Friday, February 15, 2002 12:13 PM To: '[EMAIL PROTECTED]' Subject: Left Join problem - Please Help

RE: Left Join problem - Please Help

2002-02-15 Thread Rick Emery
what the experts think. -Original Message- From: Miretsky, Anya [mailto:[EMAIL PROTECTED]] Sent: Friday, February 15, 2002 2:17 PM To: 'Rick Emery' Subject: RE: Left Join problem - Please Help Biblio has 11,901 and keyword has 87,971, also I indexed the keyword column in the keyword

RE: Left Join problem - Please Help

2002-02-15 Thread Rick Emery
possibly -Original Message- From: Miretsky, Anya [mailto:[EMAIL PROTECTED]] Sent: Friday, February 15, 2002 2:32 PM To: 'Rick Emery' Subject: RE: Left Join problem - Please Help When I do this without specifying a left join with just :select biblio.* from biblio,keyword where p_biblio

RE: Left Join problem - Please Help

2002-02-15 Thread Roger Baklund
* Miretsky, Anya Select distinct biblio.* from biblio left join keyword on biblio.p_biblio=keyword.fk_biblio where keyword=SOMESTRING; Try swapping the tables: Select distinct biblio.* from keyword left join biblio on biblio.p_biblio=keyword.fk_biblio where keyword=SOMESTRING; The left

Left Join problem

2001-10-03 Thread George Eric R Contr AFSPC/CVYZ
I'm not getting the behavior I expect from this select. SELECT available.target, tracked.sensor FROM available LEFT JOIN tracked ON available.target=tracked.target WHERE available.window=137 AND tracked.window=137 AND available.sensor=8; Now, I know for this window, that there are 25 records

RE: Left Join problem

2001-10-03 Thread Johnson, Gregert
AFSPC/CVYZ [mailto:[EMAIL PROTECTED]] Sent: Wednesday, October 03, 2001 11:50 AM To: [EMAIL PROTECTED] Subject:Left Join problem I'm not getting the behavior I expect from this select. SELECT

RE: Left Join problem

2001-10-03 Thread George Eric R Contr AFSPC/CVYZ
- From: Johnson, Gregert [mailto:[EMAIL PROTECTED]] Sent: Wednesday, October 03, 2001 10:03 AM To: [EMAIL PROTECTED] Subject: RE: Left Join problem It looks to me as though the tracked.window=137 condition is suppressing output of any available rows which do not have a target match in tracked

RE: Left Join problem

2001-10-03 Thread Johnson, Gregert
- From: George Eric R Contr AFSPC/CVYZ [mailto:[EMAIL PROTECTED]] Sent: Wednesday, October 03, 2001 12:08 PM To: [EMAIL PROTECTED] Subject:RE: Left Join problem Ok, I can see that now. If the record doesn't exist

Re: Left Join problem

2001-10-03 Thread Carl Troein
George Eric R Contr AFSPC/CVYZ writes: Ok, I can see that now. If the record doesn't exist in the tracked table, it can't meet the window criteria. The one way I see to get around this, in the absense of subselects, is to retrieve the tracked data that meets the window criteria into a

Left Join Problem

2001-09-20 Thread Scott Gerhardt
I'm not currently on the mailing list so please reply directly. I have three tables joined as follows (Table WORKPLACE is just a codes lookup with wrk_id and name): MEMBERS(A) | EMPLOY(B) | WORKPLACE(C) -- mem_id mem_id

Query/Left Join problem

2001-02-15 Thread Roger Ramirez
Hi there. I'm having a problem with a couple of tables I'm using and finding some missing records and I was hoping someone could help me. Here is the setup. I have a table that is called "perms". Within here I have a bunch of columns, only 2 of which are important. ID which is an auto

RE: Query/Left Join problem

2001-02-15 Thread Quentin Bennett
newsletter_subscription.member_id0 AND (perms.id IS NULL OR mass_mail='No'); Does that give you what you need? Regards Quentin -Original Message- From: Roger Ramirez [mailto:[EMAIL PROTECTED]] Sent: Friday, 16 February 2001 08:34 To: MySQL List Subject: Query/Left Join problem Hi there. I'm having

RE: Query/Left Join problem

2001-02-15 Thread Roger Ramirez
Duh why didn't I think of that. Thank you graciously. :) -Original Message- From: Quentin Bennett [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 15, 2001 4:26 PM To: 'Roger Ramirez'; MySQL List Subject: RE: Query/Left Join problem Hi, Your left join tried to find members