RE: Join Problem

2010-08-16 Thread andrew.2.moore
Review your join type. From: ext Gavin Towey [gto...@ffn.com] Sent: 16 August 2010 19:36 To: Victor Subervi; mysql@lists.mysql.com Subject: RE: Join Problem What do you mean by "not working?" What results do you get? -Original Message

RE: Join Problem

2010-08-16 Thread Gavin Towey
What do you mean by "not working?" What results do you get? -Original Message- From: Victor Subervi [mailto:victorsube...@gmail.com] Sent: Monday, August 16, 2010 6:59 AM To: mysql@lists.mysql.com Subject: Join Problem Hi; I have this code: select f.id from Flights f joi

Join Problem

2010-08-16 Thread Victor Subervi
Hi; I have this code: select f.id from Flights f join Planes p where f.plane_id=p.id and p.in_service=1 mysql> describe Flights; +-+---+--+-+-++ | Field | Type | Null | Key | Default | Extra | +-+-

Re: Another Join Problem

2009-10-02 Thread Victor Subervi
Thanks V On Fri, Oct 2, 2009 at 11:08 AM, Mark Goodge wrote: > Victor Subervi wrote: > >> Hi; >> I get the following error: >> >> *SQL query:* >> >> SELECT ID, Item >> FROM products >> JOIN categories ON categories.ID = products.Category >> LIMIT 0 , 30; >> >> *MySQL said:* >> #1052 - Column '

Re: Another Join Problem

2009-10-02 Thread Shawn Green
Victor Subervi wrote: Hi; I get the following error: *SQL query:* SELECT ID, Item FROM products JOIN categories ON categories.ID = products.Category LIMIT 0 , 30; *MySQL said:* #1052 - Column 'ID' in field list is ambiguous Please note the error is about ambiguity. "products" has an ID fiel

Re: Another Join Problem

2009-10-02 Thread Mark Goodge
Victor Subervi wrote: Hi; I get the following error: *SQL query:* SELECT ID, Item FROM products JOIN categories ON categories.ID = products.Category LIMIT 0 , 30; *MySQL said:* #1052 - Column 'ID' in field list is ambiguous Please note the error is about ambiguity. "products" has an ID fiel

Re: Another Join Problem

2009-10-02 Thread John Daisley
Qualify the column names. EG SELECT categories.ID, products.Item FROM products JOIN categories ON categories.ID = products.Category LIMIT 0 , 30; Regards John Daisley > Hi; > I get the following error: > > *SQL query:* > > SELECT ID, Item > FROM products > JOIN categories ON categories.ID =

Re: Another Join Problem

2009-10-02 Thread David Giragosian
On Fri, Oct 2, 2009 at 10:53 AM, Victor Subervi wrote: > Hi; > I get the following error: > > *SQL query:* > > SELECT ID, Item > FROM products > JOIN categories ON categories.ID = products.Category > LIMIT 0 , 30; > > *MySQL said:* > #1052 - Column 'ID' in field list is ambiguous > > Please note

Another Join Problem

2009-10-02 Thread Victor Subervi
Hi; I get the following error: *SQL query:* SELECT ID, Item FROM products JOIN categories ON categories.ID = products.Category LIMIT 0 , 30; *MySQL said:* #1052 - Column 'ID' in field list is ambiguous Please note the error is about ambiguity. "products" has an ID field and so does "categorie

Re: Natural join problem

2009-09-10 Thread John Meyer
Thanks. That worked. Jason Trebilcock wrote: Methinx you need a "GROUP BY" in there. See below. -Original Message- From: John Meyer [mailto:john.l.me...@gmail.com] Sent: Thursday, September 10, 2009 6:48 PM To: mysql@lists.mysql.com Subject: Natural join problem

RE: Natural join problem

2009-09-10 Thread Jason Trebilcock
Methinx you need a "GROUP BY" in there. See below. > -Original Message- > From: John Meyer [mailto:john.l.me...@gmail.com] > Sent: Thursday, September 10, 2009 6:48 PM > To: mysql@lists.mysql.com > Subject: Natural join problem > > Two tables: >

Natural join problem

2009-09-10 Thread John Meyer
Two tables: USERS: USER_ID (PK) . . .etc TWEETS: TWEET_ID (PK) USER_ID (FK) Trying to get the user information and the number of tweets each person has: SELECT USERS.USER_NAME, COUNT(TWEETS.TWEET_ID) AS 'TWEETCOUNT' FROM TWEETS NATURAL JOIN USERS; But it seems to be just rolling up all the

RE: LEFT JOIN problem

2008-04-14 Thread Jerry Schwartz
ington Ave. 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:

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 or

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.

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 rer

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-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 exi

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, oversk

RE: Left join problem

2007-09-05 Thread Jerry Schwartz
hermer Didriksen [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

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 gi_

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

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, db.tab

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 FROM

[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 tab_b.i

Re: LEFT JOIN problem

2005-11-05 Thread Rhino
: "Guy Brom" <[EMAIL PROTECTED]> To: 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

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 >

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: classic outer join problem

2005-05-24 Thread mfatene
Hi Hank, I think your problem is to find all the files under /uploads by a command like : cd /uploads ls -lR | grep ".doc" >files.txt then load the files.txt into a temporary table TEMPtable that you create for this issue (see http://dev.mysql.com/doc/mysql/en/load-data.html), after truncating it

Re: classic outer join problem

2005-05-24 Thread SGreen
Hank <[EMAIL PROTECTED]> wrote on 05/24/2005 05:02:47 PM: > I have a table of school class assignments with the following fields - > the first four fields are the primary key: > > Year (int) > Term (enum, "Spring", "Fall","Winter") > ClassID (int) > SectionID (int) > Attachement (varchar 225) >

classic outer join problem

2005-05-24 Thread Hank
I have a table of school class assignments with the following fields - the first four fields are the primary key: Year (int) Term (enum, "Spring", "Fall","Winter") ClassID (int) SectionID (int) Attachement (varchar 225) The "attachment" field is a pointer to a file in the OS of an uploaded file,

Re: JOIN Problem

2005-02-17 Thread Albert Padley
On Feb 17, 2005, at 10:34 AM, [EMAIL PROTECTED] wrote: Albert Padley <[EMAIL PROTECTED]> wrote on 02/17/2005 12:08:31 PM: > I have the following 2 tables: > > CREATE TABLE `division_info` ( >    `id` int(11) NOT NULL auto_increment, >    `division` varchar(50) NOT NULL default '', >    `spot

Re: JOIN Problem

2005-02-17 Thread SGreen
Michael Dykman <[EMAIL PROTECTED]> wrote on 02/17/2005 12:20:44 PM: > On Thu, 2005-02-17 at 12:08, Albert Padley wrote: > > I have the following 2 tables: > > > > CREATE TABLE `division_info` ( > >`id` int(11) NOT NULL auto_increment, > >`division` varchar(50) NOT NULL default '', > >

Re: JOIN Problem

2005-02-17 Thread Michael Dykman
s only for compatibility with odbc". > thanks! > > >From: Michael Dykman <[EMAIL PROTECTED]> > >To: Albert Padley <[EMAIL PROTECTED]> > >CC: "\"MySQL List\"" > >Subject: Re: JOIN Problem > >Date: Thu, 17 Feb 2005 12:20

Re: JOIN Problem

2005-02-17 Thread SGreen
Albert Padley <[EMAIL PROTECTED]> wrote on 02/17/2005 12:08:31 PM: > I have the following 2 tables: > > CREATE TABLE `division_info` ( >`id` int(11) NOT NULL auto_increment, >`division` varchar(50) NOT NULL default '', >`spots` int(11) NOT NULL default '0', >PRIMARY KEY (`id`), >

Re: JOIN Problem

2005-02-17 Thread mel list_php
CTED]> CC: "\"MySQL List\"" Subject: Re: JOIN Problem Date: Thu, 17 Feb 2005 12:20:44 -0500 On Thu, 2005-02-17 at 12:08, Albert Padley wrote: > I have the following 2 tables: > > CREATE TABLE `division_info` ( >`id` int(11) NOT NULL auto_increment, >`divis

Re: JOIN Problem

2005-02-17 Thread Michael Dykman
On Thu, 2005-02-17 at 12:08, Albert Padley wrote: > I have the following 2 tables: > > CREATE TABLE `division_info` ( >`id` int(11) NOT NULL auto_increment, >`division` varchar(50) NOT NULL default '', >`spots` int(11) NOT NULL default '0', >PRIMARY KEY (`id`), >KEY `division`

JOIN Problem

2005-02-17 Thread Albert Padley
I have the following 2 tables: CREATE TABLE `division_info` ( `id` int(11) NOT NULL auto_increment, `division` varchar(50) NOT NULL default '', `spots` int(11) NOT NULL default '0', PRIMARY KEY (`id`), KEY `division` (`division`), KEY `spots` (`spots`) ) TYPE=MyISAM CREATE TABLE `team_

RE: 4.0.18 -> 4.1.7 LEFT JOIN problem

2004-11-23 Thread Donny Simonton
olubchik [mailto:[EMAIL PROTECTED] > Sent: 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: > > > > > > > &

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.

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 'optimiza

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

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: 4.1.7-log

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 don

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

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 t

Repost: Order by RAND + join problem

2004-06-01 Thread Gerske, Sebastian
Hello list, im having a hughe problem with the RAND() function first of all im using mysql 3.23 so subquerys are impossible. Im having three tables which are joined by ID's now i want to select a single row random out of the join set whats the best way to do it? My Table structure is: table1

Re: join problem: indexed columns being ignored

2004-04-07 Thread Jim Page - EMF Systems Ltd
Thanks for the suggestion, but according to explain we are in worse shape than before. In both cases the multi-column index is ignored. I am going to try fiddling with the index col order to see if this helps. Here is what it comes up with as you suggested: Query1: explain SELECT COUNT(*) as Nu

join problem: indexed columns being ignored

2004-04-07 Thread Jim Page - EMF Systems Ltd
Afternoon all. I wonder if any experts on the join optimiser could help me out. I have read the docs, including the material on how mysql optimises joins, and have redesigned my schema somewhat to try and simplify the joins, and that has worked to some extent. But I am still way off the performance

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 opti

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 completel

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 th

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?

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

[SOLVED]Re: LEFT JOIN problem

2003-11-20 Thread Nobody
those who 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: LEF

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 t

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: Slow query join problem

2003-09-18 Thread Allen
Yes, you are correct. I was thinking that wouldn't be the case, but it makes sense now. I added indexes and then the query returned in a few seconds. Definitely have to have indexes. Thanks! Dan Nelson wrote: In the last episode (Sep 18), Allen said: I have two tables. One table is 13 milli

Re: Slow query join problem

2003-09-18 Thread Joseph Bueno
Allen wrote: I have two tables. One table is 13 million rows the other is about 250,000. I am trying to join the two to find users. The tables are not indexed and I know that will effect the speed, but the join never completes. I let it run for about 10 hours and the process was stuck in th

Re: Slow query join problem

2003-09-18 Thread Dan Nelson
In the last episode (Sep 18), Allen said: > I have two tables. One table is 13 million rows the other is about > 250,000. I am trying to join the two to find users. The tables are not > indexed and I know that will effect the speed, but the join never > completes. I let it run for about 10 h

Slow query join problem

2003-09-18 Thread Allen
I have two tables. One table is 13 million rows the other is about 250,000. I am trying to join the two to find users. The tables are not indexed and I know that will effect the speed, but the join never completes. I let it run for about 10 hours and the process was stuck in the "sending" state

Re: SELECT query with OUTER JOIN - problem

2003-06-03 Thread Jim Winstead
On Mon, Jun 02, 2003 at 12:48:38PM +0200, Dejan Milenkovic wrote: > I have two tables, one is containing data about courses and the second one > is containing data about course start date. > Is it possible to list all courses with one query which should also return > earliest scheduled start dates

SELECT query with OUTER JOIN - problem

2003-06-02 Thread Dejan Milenkovic
Hi, I have two tables, one is containing data about courses and the second one is containing data about course start date. Is it possible to list all courses with one query which should also return earliest scheduled start dates for courses (which are in the second table). I tried something like t

RE: Join problem

2003-05-31 Thread Susan Ator
Friday, May 30, 2003 3:42 PM To: [EMAIL PROTECTED] Cc: Susan Ator Subject: RE: Join problem > Well, I'm running 3.23.54 on Red Hat 7.3. Given this, how in the world > do I accomplish the following: > > I have these tables: > dacspriv - with d

RE: Join problem

2003-05-31 Thread William R. Mussatto
; -Original Message- > From: Ryan McDougall [mailto:[EMAIL PROTECTED] > Sent: Friday, May 30, 2003 12:11 PM > To: mysql > Subject: Re: Join problem > > >> Short answer is mysql does not do sub-selects (i.e., a select inside >> of a select). The join part is not th

Re: Join problem

2003-05-31 Thread William R. Mussatto
>> Short answer is mysql does not do sub-selects (i.e., a select inside >> of a select). The join part is not this issue. > > Wouldn't this depend on the version... I thought the newest versions, > 4.x+, supported sub-selects. > > Ryan > > __ > Do you Yahoo!? > Yahoo

RE: Join problem

2003-05-31 Thread Susan Ator
Sent: Friday, May 30, 2003 12:11 PM To: mysql Subject: Re: Join problem > Short answer is mysql does not do sub-selects (i.e., a select inside of a > select). The join part is not this issue. Wouldn't this depend on the version... I thought the newest versions, 4.x+, supported su

Re: Join problem

2003-05-31 Thread Ryan McDougall
> Short answer is mysql does not do sub-selects (i.e., a select inside of a > select). The join part is not this issue. Wouldn't this depend on the version... I thought the newest versions, 4.x+, supported sub-selects. Ryan __ Do you Yahoo!? Yahoo! Calendar - Free

Re: Join problem

2003-05-31 Thread William R. Mussatto
> O. I've got a headache trying to understand joins. I'm definitely > NOT a database guru. > > Why in the world doesn't this work? > > > SELECT dacspriv_name > FROM dacspriv > WHERE dacspriv_id not in (SELECT dacspriv_id > FROM dacs_access JOIN users > ON dacs_access.user_id=users.user_id > WHE

Join problem

2003-05-31 Thread Susan Ator
O. I've got a headache trying to understand joins. I'm definitely NOT a database guru. Why in the world doesn't this work? SELECT dacspriv_name FROM dacspriv WHERE dacspriv_id not in (SELECT dacspriv_id FROM dacs_access JOIN users ON dacs_access.user_id=users.user_id WHERE users.username='sa

Re[2]: JOIN-Problem

2003-03-21 Thread Stefan Hinz
Sorin, >> Okay, here for another wild guess: >> SELECT u.login, p.name, sp.name, SUM(t.time) >> FROM t_user u >> LEFT JOIN t_project p ON 1 >> LEFT JOIN t_subproject sp ON p.id = sp.project_id >> LEFT JOIN t_time t ON ?? = ?? >> WHERE u.login = 'amg' >> GROUP BY p.name >> Where I'm not sure if you

Re: JOIN-Problem

2003-03-21 Thread Sorin Marti
Stefan Hinz wrote: Okay, here for another wild guess: SELECT u.login, p.name, sp.name, SUM(t.time) FROM t_user u LEFT JOIN t_project p ON 1 LEFT JOIN t_subproject sp ON p.id = sp.project_id LEFT JOIN t_time t ON ?? = ?? WHERE u.login = 'amg' GROUP BY p.name Where I'm not sure if you will need t

Re: JOIN-Problem

2003-03-21 Thread Stefan Hinz
Sorin, > If there are entries which are: > 60 / amg / 5 > 120 / amg / 5 > (in this example '5' is the id of the calculation-subproject) > Then the result should be: > +---+---+---+---+ > | login | name | name |

JOIN-Problem

2003-03-21 Thread Sorin Marti
Hi all, I posted my question a short time ago and didn't receive any answers. So I am trying describe it better. I want to select For every user (from table t_user), every project (from t_project) and from every project I want to select every subproject which has the id of the project (t_subpr

INNER JOIN problem

2003-01-03 Thread hschassen
I hope someone can help. I have a table that has serveral records with the same name but unique datestamps. I need to show only the records with the latest datestamp associated with them. I am enclosing the sql that I am working with in hopes that someone can see the problem that I can't. I cras

Temp table / join problem, just keeps saying copy to tmp...

2002-12-12 Thread JStanczak
Hi all. I'm having trouble this a process that just keeps running. To view this process I'm using the msql SHOW PROCESSLIST command. Here's the message I'm seeing: 38 | bb50 | localhost | bb50 | Query | 197 | Copying to tmp table | select a.pk1,a.sos_id_pk2, a.name, count(q.pk1)

Re: mysql join problem (bug?)

2002-12-02 Thread DL Neil
t; > > > 1 4 1 4 > > > > > > If that is the case, is this a Win-XP specific bug? > Can someone running versions other than MySQL 4.0.5-beta on XP verify if > it is a bug please? > > Thanks! > > > Haksun > > > -Original Message

RE: mysql join problem (bug?)

2002-12-01 Thread Haksun Li
ecember 01, 2002 3:39 PM > To: Haksun Li; [EMAIL PROTECTED] > Subject: Re: mysql join problem (bug?) > > Hi Haksun, > Cross-join works perfectly on 3.23.53-max-nt under Win2000 SP2, both from > command line and MySQL Control Center 0.8.6-alpha. > Regards, > =dn >

Re: mysql join problem (bug?)

2002-12-01 Thread DL Neil
Hi Haksun, Cross-join works perfectly on 3.23.53-max-nt under Win2000 SP2, both from command line and MySQL Control Center 0.8.6-alpha. Regards, =dn > Hi all, > > > > I found this join problem using mysql 3.23.53-max-nt (on WinXP). > > It works fine on MySQL 3.23.52-log (on

mysql join problem (bug?)

2002-11-30 Thread Haksun Li
Hi all, I found this join problem using mysql 3.23.53-max-nt (on WinXP). It works fine on MySQL 3.23.52-log (on Linux). Could someone please confirm that it is a bug? Or enlighten me on writing the correct sql? I have a table and data as shown in the script below. CREATE TABLE

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 sta

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 NUL

Re: Join problem in MYSQL

2002-07-08 Thread Egor Egorov
Defryn, Monday, July 08, 2002, 5:09:51 AM, you wrote: D> Can anyone have a look at my join. D> It returns errors D> Select O.name, O.amount , P.Productname, P.price D> From Orders AS O D> JOIN Products AS P ON O.product=P.Productid D> Where O.cluster= 'ANP'; D> It works fine when I use D> Sel

Join problem in MYSQL

2002-07-07 Thread Defryn, Guy
sql,query Can anyone have a look at my join. It returns errors Select O.name, O.amount , P.Productname, P.price >From Orders AS O JOIN Products AS P ON O.product=P.Productid Where O.cluster= 'ANP'; It works fine when I use Select O.Name, O.amount, P.productname , P.price >From Orders as O,

mysql...category--unlimited sub category level--self join problem...

2002-05-09 Thread open source devel company
hello to all mysql list subscribers , I have a problem which I think can be solved by SELF JOIN but I can't figure out how to do it here is table definition CREATE TABLE first ( firstcolumn int(11) default NULL, secondcolumn int(11) default NULL ) TYPE=MyISAM; INSERT INTO first VALUES (0

Re: Join problem, Please help.

2002-04-01 Thread Christopher Thompson
On Monday 01 April 2002 10:56 am, IvanLatysh wrote: > Hi. > I am running MySQL 3.23.44-Max > > I have 2 tables. > > Table "A" > +---++ > IDName > +---++ > 1 string 1 > 2 string 2 > +---++ > > Table "B" > > +---++ > IDName > +---++ > 2

Join problem, Please help.

2002-04-01 Thread IvanLatysh
Hi. I am running MySQL 3.23.44-Max I have 2 tables. Table "A" +---++ IDName +---++ 1 string 1 2 string 2 +---++ Table "B" +---++ IDName +---++ 2 string 2 3 string 3 +---++ And I need result +---++ ID

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, '25-

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 l

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 wher

RE: Left Join problem - Please Help

2002-02-15 Thread Rick Emery
he mysql list to see 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

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 proble

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 what

Re: Join Problem

2001-12-14 Thread Gerald Clark
Dave Butler wrote: > I am struggling with a join query using MySQL 3.23.31 under AIX 4.3.3. > Here are the tables involved: > > select CAT.linenum, CAT.acct, FD.amount > from sched_acct_cat CAT LEFT JOIN fd FD > ON CAT.acct = FD.acct > where CAT.sched_acct = 'INC_STMT' > AND FD.entity='FMCI'

Join Problem

2001-12-14 Thread Dave Butler
I am struggling with a join query using MySQL 3.23.31 under AIX 4.3.3. Here are the tables involved: CREATE TABLE sched_acct_cat ( sched_acct varchar(8) NOT NULL default '', linenum int(11) unsigned NOT NULL default '0', acct varchar(8) default NULL, label varchar(40) default NULL, ind

Re: Query and join problem with null values

2001-12-07 Thread Michael Delorme
Thanks ! It's exactlly what I wanted. I got the same result a few seconds ago using EMS MySQL Manager but I didn't understand how. Your example is much better ! What is the difference between a LEFT JOIN and a LEFT OUTER JOIN ? And of course you're right for the data type ; Thanks again A

Re: Query and join problem with null values

2001-12-07 Thread Etienne Marcotte
mysql> create table users( -> usrID smallint unsigned auto_increment, -> usrZip char(5), -> primary key(usrID)); Query OK, 0 rows affected (0.00 sec) mysql> create table cities( -> ctyZip char(5) not null, -> ctyName varchar(30) not null, -> primary key(ctyZip)); Query OK,

RE: Query and join problem with null values

2001-12-07 Thread Michael Delorme
>people.zip = city.zip > >yo get 2 rows from people 1 and 3 > >notice there is no peopleid 2 from first join so correct answer is to retun >null > >Rick > >-Original Message- >From: Michaël Delorme [mailto:[EMAIL PROTECTED]] >Sent: Friday, December 07, 2001

RE: Query and join problem with null values

2001-12-07 Thread rick herbel
: [EMAIL PROTECTED] Subject: Query and join problem with null values Hi guys I have a problem on a SQL query : I got no records selected. Below is a sample of my 2 tables : A table identifying people, containing their adress therefore a ZIP code. However for some people I don't have their a

  1   2   >