Re: Trouble with LEFT JOIN

2015-09-25 Thread Richard Reina
1.00 | >>> | 2 | 4 | 3 | 2.00 | >>> | 3 | 3 | 6 | 1.00 | >>> ++---+-----++ >>> I would like to select all rows from challenges which are NOT linked

RE: Trouble with LEFT JOIN

2015-09-25 Thread Adrian Beech
Hi There, If I interpreted what you are trying to do is to return all the rows from Challenge and reference Patrocinio excluding those rows in Patrocinio where PTRN_ID is 1? Not sure if the below is possible in MySQL but I've used this in other places when doing a left join and needing

Trouble with LEFT JOIN

2015-09-04 Thread Richard Reina
1.00 | ++---+-++ I would like to select all rows from challenges which are NOT linked to a patrocinio with the PTRN_ID -- which would be rows 2 through 6 of challenges. I am trying to go about this with a LEFT JOIN query but it does not seem to be working for me. mysql> select

Re: Trouble with LEFT JOIN

2015-09-04 Thread Peter Brawley
6 | 1.00 | ++---+-++ I would like to select all rows from challenges which are NOT linked to a patrocinio with the PTRN_ID -- which would be rows 2 through 6 of challenges. I am trying to go about this with a LEFT JOIN query but it does no

Re: Trouble with LEFT JOIN

2015-09-04 Thread Richard Reina
>> | 3 | 3 | 6 | 1.00 | >> ++---+-+----+ >> I would like to select all rows from challenges which are NOT linked to a >> patrocinio with the PTRN_ID -- which would be rows 2 through 6 of >> challeng

Re: Trouble with LEFT JOIN

2015-09-04 Thread Peter Brawley
_ID -- which would be rows 2 through 6 of challenges. I am trying to go about this with a LEFT JOIN query but it does not seem to be working for me. mysql> select c.ID FROM challenge c LEFT JOIN patrocinio p ON c.ID=p.CHLNG_ID WHERE p.PTRN_I

left join two tables

2011-04-28 Thread Rocio Gomez Escribano
Hi!! Is it possible to create a left join consult with 2 tables?? I mean: SELECT * FROM table1 LEFT JOIN (table2, table3) on table1.ID = table2.subID and table1.ID= table3.subID Thanks!!! Rocío Gómez Escribano mailto:r.sanc...@ingenia-soluciones.com r.go...@ingenia-soluciones.com

Re: left join two tables

2011-04-28 Thread Johan De Meersman
Hey there, - Original Message - From: Rocio Gomez Escribano r.go...@ingenia-soluciones.com Hi!! Is it possible to create a left join consult with 2 tables?? I mean: SELECT * FROM table1 LEFT JOIN (table2, table3) on table1.ID = table2.subID and table1.ID= table3.subID Pretty

Re: left join two tables

2011-04-28 Thread Darryle Steplight
Hi Johan, I think you probably want something like this. Give the following a shot. SELECT * FROM table1 LEFT JOIN table2 ON table1.ID = table2.subID LEFT JOIN table3 ON table1.ID= table3.subID On Thu, Apr 28, 2011 at 9:41 AM, Johan De Meersman vegiv...@tuxera.be wrote: Hey

Re: LEFT JOIN and WHERE: identical or not and what is better?, etc.

2011-04-26 Thread Hal�sz S�ndor
2011/04/25 17:42 +0300, Andre Polykanine Here is the first one. We have two queries: SELECT `blogs`.* FROM `Blogs` LEFT JOIN `Users` ON `Blogs`.`UserId`=`Users`.`Id`; and the following one: SELECT `Blogs`.* FROM `Blogs`, `Users` WHERE `Blogs`.`UserId`=`Users

Re: LEFT JOIN and WHERE: identical or not and what is better?, etc.

2011-04-26 Thread Suresh Kuna
I would go with join rather than where condition. 2011/4/26 Halász Sándor h...@tbbs.net 2011/04/25 17:42 +0300, Andre Polykanine Here is the first one. We have two queries: SELECT `blogs`.* FROM `Blogs` LEFT JOIN `Users` ON `Blogs`.`UserId`=`Users`.`Id`; and the following one

Re: LEFT JOIN and WHERE: identical or not and what is better?, etc.

2011-04-26 Thread Andre Polykanine
://twitter.com/m_elensule Facebook: http://facebook.com/menelion Original message From: Halбsz Sбndor h...@tbbs.net To: Andre Polykanine Date created: , 7:00:03 AM Subject: LEFT JOIN and WHERE: identical or not and what is better?, etc. 2011/04/25 17:42 +0300, Andre

Re: LEFT JOIN and WHERE: identical or not and what is better?, etc.

2011-04-26 Thread Hal�sz S�ndor
2011/04/26 17:55 +0300, Andre Polykanine Aha. So, I should write SELECT `Blogs`.* INNER JOIN `Users` ON `Users`.`Id`=`Blogs`.`UserId` instead of my original WHERE clause? Thanks! I think so. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To

LEFT JOIN and WHERE: identical or not and what is better?

2011-04-25 Thread Andre Polykanine
queries: SELECT `blogs`.* FROM `Blogs` LEFT JOIN `Users` ON `Blogs`.`UserId`=`Users`.`Id`; and the following one: SELECT `Blogs`.* FROM `Blogs`, `Users` WHERE `Blogs`.`UserId`=`Users`.`Id`; 1. Are they identical? 2. Which is better (faster, more optimal

Re: LEFT JOIN and WHERE: identical or not and what is better?

2011-04-25 Thread Mitchell Maltenfort
some advanced things (earlier I accomplished  those  tasks  with  PHP),  so  I  will  be asking stupid questions, please bear with me. Here is the first one. We have two queries: SELECT `blogs`.* FROM     `Blogs`     LEFT     JOIN     `Users`     ON `Blogs`.`UserId`=`Users`.`Id

Re: LEFT JOIN and WHERE: identical or not and what is better?

2011-04-25 Thread Jo�o C�ndido de Souza Neto
stupid questions, please bear with me. Here is the first one. We have two queries: SELECT `blogs`.* FROM `Blogs` LEFT JOIN `Users` ON `Blogs`.`UserId`=`Users`.`Id`; and the following one: SELECT `Blogs`.* FROM `Blogs`, `Users` WHERE `Blogs`.`UserId

Re: LEFT JOIN and WHERE: identical or not and what is better?

2011-04-25 Thread Johnny Withers
The only difference once MySQL parses these two queries is the first one is a LEFT JOIN, which will produce all records from the blogs table even if there is no matching record in the users table. The second query produces an INNER JOIN which means only rows with matching records in both tables

Re: LEFT JOIN and WHERE: identical or not and what is better?

2011-04-25 Thread Joerg Bruehe
bear with me. Here is the first one. We have two queries: SELECT `blogs`.* FROM `Blogs` LEFT JOIN `Users` ON `Blogs`.`UserId`=`Users`.`Id`; and the following one: SELECT `Blogs`.* FROM `Blogs`, `Users` WHERE `Blogs`.`UserId`=`Users`.`Id`; 1

Slow queries when using left join

2010-03-19 Thread Olav Mørkrid
Dear MySQL forum. I have performance problems when using left join x combined with where x.y is null, in particularily when combining three tables this way. Please contact me by e-mail if you are familiar with these issues and know how to eliminate slow queries. I would really appreciate your

Re: Slow queries when using left join

2010-03-19 Thread Johan De Meersman
2010/3/19 Olav Mørkrid olav.mork...@gmail.com Dear MySQL forum. I have performance problems when using left join x combined with where x.y is null, in particularily when combining three tables this way. With a left join, particularly when you're using *is (not) null*, you can't use index

RE: Left join query

2009-06-01 Thread Gavin Towey
A LEFT OUTER JOIN in that query in not necessary. An inner join should be used. -Original Message- From: Shiv [mailto:shiv...@gmail.com] Sent: Saturday, May 30, 2009 10:18 PM To: bharani kumar Cc: mysql Subject: Re: Left join query Hi, Along with tables, you should also provide

Re: Left join query

2009-05-30 Thread Shiv
Hi, Along with tables, you should also provide details on how they are related. Assuming Code is unique in both tables and left joined on Airport table, you can do something like this SELECT A.Code, C.Code, A.SlNo, C.SlNo, A.Name, C.Location, A.status, C.status, C.type FROM Airport A LEFT

Left join query

2009-05-29 Thread bharani kumar
Airport table SlNoName Code AuthLocation status 1 ChennaiCHN Yes India 1 2. Hydarabed HYD Yes India 0 3 walkerWAK Yes uk1 common table SlNoName Code

RE: LEFT JOIN with third-table key

2009-04-13 Thread Jerry Schwartz
-Original Message- From: shawn.gr...@sun.com [mailto:shawn.gr...@sun.com] Sent: Saturday, April 11, 2009 3:50 PM To: Jerry Schwartz Cc: mysql@lists.mysql.com Subject: Re: LEFT JOIN with third-table key Jerry Schwartz wrote: This is a question that I run into frequently; I might even

Re: LEFT JOIN with third-table key

2009-04-11 Thread Shawn Green
customer, so I want to filter on publisher. I know that I can do this with a sub-select: UPDATE `A` LEFT JOIN (SELECT B.product_id FROM `C` JOIN B ON C.publisher_id = B.publisher_id JOIN `D` ON B.product_id = D.product_id WHERE C.publisher_code = 'Fred' ) AS `X` ON A.pub_product_id

LEFT JOIN with third-table key

2009-04-06 Thread Jerry Schwartz
to filter on publisher. I know that I can do this with a sub-select: UPDATE `A` LEFT JOIN (SELECT B.product_id FROM `C` JOIN B ON C.publisher_id = B.publisher_id JOIN `D` ON B.product_id = D.product_id WHERE C.publisher_code = 'Fred' ) AS `X` ON A.pub_product_id = X.pub_product_id SET

Left join does not work with Count() as expected

2009-02-19 Thread Artem Kuchin
I have two simple tables. One - list of forums, second - list of messages and i want to get the list of forums with number of messages in each. Here is the query: SELECT forums.id , COUNT( forum_msg.id ) AS cnt FROM forums LEFT JOIN forum_msg ON forums.id = forum_msg.forum_id ORDER

Re: Left join does not work with Count() as expected

2009-02-19 Thread Olaf Stein
( forum_msg.id ) AS cnt FROM forums LEFT JOIN forum_msg ON forums.id = forum_msg.forum_id ORDER BY forums.sorder ASC The problem is that if a forum does not have any messages then the line with such forums.id does not appear at all. If i delete COUNT( forum_msg.id ) AS cnt from Select - i get

Re: Left join does not work with Count() as expected

2009-02-19 Thread Peter Brawley
SELECT forums.id , COUNT( forum_msg.id ) AS cnt FROM forums LEFT JOIN forum_msg ON forums.id = forum_msg.forum_id ORDER BY forums.sorder ASC Missing GROUP BY. PB - Artem Kuchin wrote: I have two simple tables. One - list of forums, second - list of messages and i want to get the list

RE: Left join does not work with Count() as expected

2009-02-19 Thread Martin Gainty
Following the documentation available at http://dev.mysql.com/doc/refman/5.0/en/join.html t1t2 a b a c --- --- 1 x 2 z 2 y 3 w Then a natural left join would product these results mysql SELECT * FROM t1 NATURAL LEFT JOIN t2; +--+--+--+ | a| b

LEFT JOIN and RIGHT JOIN

2008-07-22 Thread Ananda Kumar
Hi All, Can u please let me know when should i use LEFT JOIN and when should i going for a RIGHT JOIN. Please let me know some examples. regards anandkl

Re: LEFT JOIN and RIGHT JOIN

2008-07-22 Thread mos
At 09:05 AM 7/22/2008, you wrote: Hi All, Can u please let me know when should i use LEFT JOIN and when should i going for a RIGHT JOIN. Please let me know some examples. regards anandkl anandkl, Take a look at the tutorial at http://www.keithjbrown.co.uk/vworks/mysql/mysql_p5.php Mike

RE: LEFT JOIN and RIGHT JOIN

2008-07-22 Thread Amit Sharma
| 27 | 5 | | Sumit | 31 | 6 | | Anand | 29 | 55000 | | NULL | NULL | 1 | | NULL | NULL | 9 | +---+--++ TABLEA LEFT JOIN TABLEB mysql Select tableA.Name, tableA.Age, tableB.Salary from tableA left join tableB on tableA.Name=tableB.Name

Re: LEFT JOIN and RIGHT JOIN

2008-07-22 Thread Ananda Kumar
| +---+--++ TABLEA LEFT JOIN TABLEB mysql Select tableA.Name, tableA.Age, tableB.Salary from tableA left join tableB on tableA.Name=tableB.Name; +---+--++ | Name | Age | Salary | +---+--++ | Amit | 27 | 5 | | Sumit | 31 | 6 | | Anand | 29 | 55000 | | Parry

LEFT JOIN without temporary table?

2008-05-08 Thread Jerry Schwartz
= MYISAM; INSERT INTO prod_exists VALUES (MCP-1018), (MCP-1024), ... (MCP-1031) ; SELECT prod_exists.prod_pub_prod_id, IF(prod.prod_num IS NOT NULL,prod.prod_num,) as GII_prod_ID FROM prod_exists LEFT JOIN prod ON prod_exists.prod_pub_prod_id = prod.prod_pub_prod_id WHERE (prod.prod_discont = 0

Any better ways that LEFT JOIN?

2008-05-07 Thread sbrattla
.keyword_trackid, K2.keyword_keyword FROM keyword K1 LEFT JOIN track T1 ON T1.track_id = K1.keyword_trackid LEFT JOIN keyword K2 ON T1.track_id = K2.keyword_trackid WHERE (K1.keyword_keyword LIKE '%keyword%'); I am not really worried about full text search right now, as i am more worried about

Re: Any better ways that LEFT JOIN?

2008-05-07 Thread Velen
and matching results in table A B. This one may be slower. Regards, Velen - Original Message - From: sbrattla [EMAIL PROTECTED] To: mysql@lists.mysql.com Sent: Wednesday, May 07, 2008 6:41 PM Subject: Any better ways that LEFT JOIN? Hi, My scenario is as described below, and i am

Re: why does left join gives more results?

2008-05-05 Thread Brent Baisley
If you are getting more results, I would guess that your users table is not a list of unique users, but a list of user logins. If that is the case, then it's your LEFT JOIN and the count(*) that is causing you to get more results. If a user logs in 5 times, but only has 1 post, you will get 5

Re: why does left join gives more results?

2008-05-04 Thread Patrick Aljord
Your doing a left join which can increase the number of rows returned. This is then GROUP BYed and run through a HAVING. Is: posts.poster_id=users.id a one to one relationship? If it is not, then count(*) would be a larger number and pass the HAVING. This may not be your problem, but I

Re: why does left join gives more results?

2008-05-04 Thread Rob Wultsch
On Sun, May 4, 2008 at 5:37 PM, Patrick Aljord [EMAIL PROTECTED] wrote: Your doing a left join which can increase the number of rows returned. This is then GROUP BYed and run through a HAVING. Is: posts.poster_id=users.id a one to one relationship? If it is not, then count(*) would

why does left join gives more results?

2008-05-03 Thread Patrick Aljord
hey all, I have my query that counts posts per user: SELECT count(*) as counted, c.user_id FROM posts c group by c.user_id having counted1 order by counted DESC LIMIT 20 I wanted to add user login for each count so I did: SELECT count(*) as counted, u.login FROM posts c left join users u

Re: why does left join gives more results?

2008-05-03 Thread Rob Wultsch
On Sat, May 3, 2008 at 6:00 PM, Patrick Aljord [EMAIL PROTECTED] wrote: SELECT count(*) as counted, u.login FROM posts c left join users u on posts.poster_id=u.id group by c.user_id having counted1 order by counted DESC LIMIT 20 This is a bad query. You are abusing GROUP

LEFT JOIN problem

2008-04-14 Thread Jerry Schwartz
eo_name_table LEFT JOIN prod ON eo_name_table.eo_name = prod.prod_title AND eo_name_table.eo_pub_date = prod.prod_published WHERE (prod.prod_discont = 0 OR prod.prod_discont IS NULL) ORDER BY eo_name_table.eo_name; As expected, this gives me exactly 860 rows in the result because the left join

Re: LEFT JOIN problem

2008-04-14 Thread Bill Newton
) AS discont, IF(prod.prod_title IS NOT NULL, prod.prod_title, ) AS match_title FROM eo_name_table LEFT JOIN prod ON eo_name_table.eo_name = prod.prod_title AND eo_name_table.eo_pub_date = prod.prod_published WHERE (prod.prod_discont = 0 OR prod.prod_discont IS NULL) ORDER

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

how: many-to-many with LEFT JOIN

2008-03-10 Thread dr_pompeii
cabeceracomprobanteventa ccv LEFT JOIN detallecomprobanteventa dcv ON dcv.idCabeceraComprobanteVenta=ccv.idCabeceraComprobanteVenta LEFT JOIN articulonoauto ana ON ccv.idArticuloNoAuto=ana.idArticuloNoAuto LEFT JOIN articulo ar ON dcv.idArticulo=ar.idArticulo LEFT JOIN medida m ON m.idMedida

left join in version 5.0.45

2008-01-28 Thread Malki . Cymbalista
We have just moved to a new machine where we are running MySQL 5.0.45. On the old machine we were running MySQL 4.0.15a. The following query worked in 4.0.15a but gives an error mesage in 5.0.45. We're pretty sure the problem is with the left join. Did anything change? Here's the query

Re: left join in version 5.0.45

2008-01-28 Thread Baron Schwartz
is with the left join. Did anything change? Yes. Don't mix comma-join and ANSI join syntaxes. The precedences are terribly confusing now. To see how MySQL interprets your query, you can use EXPLAIN EXTENDED followed by SHOW WARNINGS. Here's the query: select distinct depts.dept_code, depts.sci_id

Re: left join in version 5.0.45

2008-01-28 Thread Peter Brawley
is with the left join. Did anything change? Here's the query: select distinct depts.dept_code, depts.sci_id, hr.title,hr.fname,hr.lname, aptb.entry_date from depts, hr left join crdepts aptb on depts.dept_code=aptb.dept_code where depts.sci_id=hr.sci_id depts.dept_code=90; which gives

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 (SELECT ...) -- no joy

2007-10-12 Thread mysql
| +--+--+ |1 | 101.94 | |2 |47.97 | +--+--+ 2 rows in set (0.00 sec) -- same query used in LEFT JOIN clause: mysql SELECT po.id, po.customer_id, po.delivered, od.subtotal - FROM purchase_order AS po - LEFT JOIN (SELECT order_id, SUM(quantity

Re: LEFT JOIN (SELECT ...) -- no joy

2007-10-12 Thread mysql
Andrew Carlson wrote: Is there a purchase order (10002) with no orders in the order_details table? No, PO 10002 is related to the order_id = 2 here: mysql SELECT order_id, SUM(quantity * unit_price) AS subtotal - FROM order_details GROUP BY order_id; +--+--+ | order_id |

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

Left join is not doing what I thought it should do.

2007-08-22 Thread Critters
with a userIDB matching users (or leaderboard) userID I have tried this: SELECT users.username, gameLeaderboards.playerpoints, friends.userA FROM gameLeaderboards JOIN users ON gameLeaderboards.userID = users.ID LEFT JOIN friends ON gameLeaderboards.userID = friends.userB WHERE friends.userA = 79760

RE: Left join is not doing what I thought it should do.

2007-08-22 Thread Jerry Schwartz
, August 22, 2007 12:23 PM To: MySQL General Subject: Left join is not doing what I thought it should do. I have 3 tables A users table (userID, userName) A leaderboard table (userID, score) A friends table (userIDA, userIDB) I would like to produce the following result: userName, score

Re: Left join is not doing what I thought it should do.

2007-08-22 Thread Critters
It works if I do AND instead of WHERE Go figure LEFT JOIN friends ON gameLeaderboards.userID = friends.userB AND friends.userA = 79760 -- Dave Jerry Schwartz wrote: I think your problem is that you can't have a missing friends record that also has a non-null value for friends.userA

RE: Left join is not doing what I thought it should do.

2007-08-22 Thread Jerry Schwartz
By using AND, you've moved the test for 79760 into the JOIN condition. I wouldn't have thought of that, either. This seems to be a peculiarity of a LEFT JOIN. Normally, if you compare a NULL value against anything, even another NULL, the result is NULL (neither true nor false). I don't understand

left join, right join failure with mysql4

2007-07-17 Thread Olav Mørkrid
hi i am experimenting with sql for getting lists of friends. select friend.* from user left join link on user.id=link.id and user.id = $MYID right join user friend on link.friend_id = friend.id where user.name is null; on my local windows machine running mysql 5 it works fine

RE: left join, right join failure with mysql4

2007-07-17 Thread Edward Kay
hi i am experimenting with sql for getting lists of friends. select friend.* from user left join link on user.id=link.id and user.id = $MYID right join user friend on link.friend_id = friend.id where user.name is null; on my local windows machine running mysql 5 it works

Re: left join, right join failure with mysql4

2007-07-17 Thread Olav Mørkrid
some more info on this: putting user AS friend improves the query, but does not eliminate the problem. also, here are the version numbers for each sql server: mysql Ver 12.22 Distrib 4.0.22, for portbld-freebsd4.9 (i386) mysql.exe Ver 14.12 Distrib 5.0.24, for Win32 (ia32) the query even

Question regarding Update ... LEFT JOIN

2007-01-03 Thread Jonathan Langevin
I've used the syntax, UPDATE ... LEFT JOIN a few times in the past, and today I used it again for a new employer that I work for. Several of my associates were unaware that the UPDATE ... LEFT JOIN syntax is valid in MySQL. After I demonstrated that the query does indeed work fine on our MySQL 5

RE: Question regarding Update ... LEFT JOIN

2007-01-03 Thread Jerry Schwartz
Incorporated 195 Farmington Ave. Farmington, CT 06032 860.674.8796 / FAX: 860.674.8341 -Original Message- From: Jonathan Langevin [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 03, 2007 4:13 PM To: mysql@lists.mysql.com Subject: Question regarding Update ... LEFT JOIN I've used

RE: Question regarding Update ... LEFT JOIN

2007-01-03 Thread Jonathan Langevin
; mysql@lists.mysql.com Subject: RE: Question regarding Update ... LEFT JOIN I hope it is locking both tables. Even if you aren't changing any fields in the right-hand column, you don't want anyone changing it under you. I hope that, if you aren't actually modifying the right-hand table, that MySQL uses

RE: Question regarding Update ... LEFT JOIN

2007-01-03 Thread Jonathan Langevin
the total time used for a SELECT lock) -Original Message- From: Jonathan Langevin [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 03, 2007 4:49 PM To: Jerry Schwartz; mysql@lists.mysql.com Subject: RE: Question regarding Update ... LEFT JOIN That would be fine with me, but then conversely

group by left join

2006-12-07 Thread John Heim
, S.last_name, P.college, avg(T.score) FROM students S LEFT JOIN previous_institutions P USING (studentid) LEFT JOIN test_scores T USING (campus_id) GROUP BY S.campus_id This query actually works but it makes me nervous because I believe it wouldn't even be legal in Oracle, for example. The P.college

Re: left join , Unknown column 't1.itemid' in 'on clause'

2006-11-16 Thread wang shuming
Hi, select * from t1,t2 left join t3 on t3.itemid=t1.itemid left join t4 on t4.f2=t1.f2 mysql4.1 works, but mysql5.0 shows Unknown column 't1.itemid' in 'on clause' If change into select * from t2,t1 left join t3 on t3.itemid=t1.itemid left join t4 on t4.f2=t1.f2 mysql4.1

Re: left join , Unknown column 't1.itemid' in 'on clause'

2006-11-04 Thread Rolando Edwards
This is makes more sense because it causes a SQL developer to group the joined tables in a logical manner. - Original Message - From: wang shuming [EMAIL PROTECTED] To: mysql@lists.mysql.com Sent: Friday, November 3, 2006 8:04:20 PM GMT-0500 US/Eastern Subject: left join , Unknown column

left join , Unknown column 't1.itemid' in 'on clause'

2006-11-03 Thread wang shuming
Hi, select * from t1,t2 left join t3 on t3.itemid=t1.itemid mysql4.1 works, but mysql5.0 shows Unknown column 't1.itemid' in 'on clause' If change into select * from t2,t1 left join t3 on t3.itemid=t1.itemid mysql5.0 works Shuming Wang

Complex right left join

2006-09-27 Thread Kristian Løining
Hi. Hope this is the correct list. I'm strugling with a right and left join query: SELECT category.name AS cname, service.name AS tname, service.id AS sid FROM provider LEFT JOIN providerservice ON provider.id = providerservice.provider_id RIGHT JOIN service ON providerservice.service_id

What happened to left join under version 5?

2006-09-21 Thread Mailing List Receiver
Worked under version 4. Does not work under version 5. $Qstr = select distinct replace(reftraffic.refurl,'http://',''),\ count(*)\ from reftraffic,site\ left join links\ on left(replace(reftraffic.refurl,'http://',''),locate('/',replace(reftraffic.refurl,'http

Re: What happened to left join under version 5?

2006-09-21 Thread Joerg Bruehe
Mailing List Receiver wrote: Worked under version 4. Does not work under version 5. $Qstr = select distinct replace(reftraffic.refurl,'http://',''),\ count(*)\ from reftraffic,site\ left join links\ on left(replace(reftraffic.refurl,'http://',''),locate

Re: What happened to left join under version 5?

2006-09-21 Thread Gerald L. Clark
Mailing List Receiver wrote: Worked under version 4. Does not work under version 5. $Qstr = select distinct replace(reftraffic.refurl,'http://',''),\ count(*)\ from reftraffic,site\ left join links\ on left(replace(reftraffic.refurl,'http://',''),locate

is INNER join so much slower than LEFT join ?

2006-07-27 Thread C.R.Vegelin
unsigned NOT NULL default '0', ... KEY `Country1` (`Country1`), KEY `Country2` (`Country2`) When I run then next query with LEFT join is takes approx 1 minute. UPDATE data AS db LEFT JOIN countries AS c1 ON db.Country1=c1.ID LEFT JOIN countries AS c2 ON db.Country2=c2.ID SET db.Expr = ...; But when

Re: is INNER join so much slower than LEFT join ?

2006-07-27 Thread Ow Mun Heng
On Fri, 2006-07-28 at 07:08 +0100, C.R.Vegelin wrote: But when I run it with INNER join is takes more than 2 hours !!! In both cases the query applies to 9.571.220 rows matched with 0 changed. Any idea why INNER join is so much slower ? Inner Joins joins everything, it's like a cartesian

[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

Re: [5.0] Left Join Problem

2006-07-21 Thread Paul DuBois
FROM db.tab_a, db.tab_e, db.tab_f LEFT JOIN db.tab_b ON tab_b.id = tab_a.id LEFT JOIN db.tab_c ON tab_c.id = tab_a.id LEFT JOIN db.tab_d ON tab_d.id = tab_a.id WHERE tab_a.id = 'value' AND tab_a.id2 = tab_e.id2 AND tab_e.id3 = tab_f.id3 LIMIT 1; The above query now generates this error: Unknown

Re: [5.0] Left Join Problem

2006-07-21 Thread Gerald L. Clark
, db.tab_f LEFT JOIN db.tab_b ON tab_b.id = tab_a.id LEFT JOIN db.tab_c ON tab_c.id = tab_a.id LEFT JOIN db.tab_d ON tab_d.id = tab_a.id WHERE tab_a.id = 'value' AND tab_a.id2 = tab_e.id2 AND tab_e.id3 = tab_f.id3 LIMIT 1; The above query now generates this error: Unknown column 'tab_a.id in 'on clause

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

Re: Left Join Help

2006-06-24 Thread Daniel McQuay
td INNER JOIN tbl_ARTST as art ON? INNER JOIN artist_tourdate artd ON? INNER JOIN tbl_VENUES tv ON? INNER JOIN tbl_VENUE_CAPACITY tvc ON? INNER JOIN tbl_VENUE_AGE_XREF tvax ON? INNER JOIN tbl_VENUE_AGES tvage ON? LEFT JOIN tbl_VENUE_CAPACITY ON (tv.ID=tvc.VENUE_ID) LEFT JOIN tbl_VENUE_AGE_XREF

Left Join Help

2006-06-23 Thread Paul Nowosielski
,tv.TICKETAGNCY1 as tix0, tv.TICKETAGNCY2 as tix1 FROM tourdates td, tbl_ARTST as art, artist_tourdate artd , tbl_VENUES tv, tbl_VENUE_CAPACITY tvc ,tbl_VENUE_AGE_XREF tvax, tbl_VENUE_AGES tvage LEFT JOIN tbl_VENUE_CAPACITY ON (tv.ID=tvc.VENUE_ID) LEFT JOIN tbl_VENUE_AGE_XREF ON (tv.ID

Re: Left Join Help

2006-06-23 Thread Gerald L. Clark
as capacity, tvage.TYPE as age,tv.TICKETAGNCY1 as tix0, tv.TICKETAGNCY2 as tix1 FROM tourdates td, tbl_ARTST as art, artist_tourdate artd , tbl_VENUES tv, tbl_VENUE_CAPACITY tvc ,tbl_VENUE_AGE_XREF tvax, tbl_VENUE_AGES tvage These 5 tables are not joined on anything. LEFT JOIN tbl_VENUE_CAPACITY

Re: Left Join Help

2006-06-23 Thread Brent Baisley
ON ? JOIN tbl_VENUE_AGE_XREF tvax ON ? JOIN tbl_VENUE_AGES tvage ON ? LEFT JOIN tbl_VENUE_CAPACITY ON (tv.ID=tvc.VENUE_ID) LEFT JOIN tbl_VENUE_AGE_XREF ON (tv.ID=tvax.VENUE_ID) LEFT JOIN tbl_VENUE_AGES ON (tvax.VENUE_ID = tvage.PKEY) WHERE td_date NOW() AND (td.td_id = artd.td_id AND artd.artist_id

Re: Left Join Help

2006-06-23 Thread Gerald L. Clark
, and tvage are not joined at all, producing Cartesian Products. LEFT JOIN tbl_VENUE_CAPACITY ON (tv.ID=tvc.VENUE_ID) This on condition does not include the table being joined. LEFT JOIN tbl_VENUE_AGE_XREF ON (tv.ID=tvax.VENUE_ID) This on condition does not include the table being joined

Re: Left Join Help

2006-06-23 Thread Peter Brawley
Paul, SELECT ... FROM tourdates td, tbl_ARTST as art, artist_tourdate artd , tbl_VENUES tv, tbl_VENUE_CAPACITY tvc , tbl_VENUE_AGE_XREF tvax, tbl_VENUE_AGES tvage LEFT JOIN tbl_VENUE_CAPACITY ON (tv.ID=tvc.VENUE_ID) LEFT JOIN tbl_VENUE_AGE_XREF ON (tv.ID=tvax.VENUE_ID) LEFT JOIN

Re: Left Join Help SOLVED

2006-06-23 Thread Paul Nowosielski
ON (artd.artist_id = art.PKEY) JOIN tbl_VENUES tv ON (td.venue_id = tv.ID) LEFT JOIN tbl_VENUE_CAPACITY tvc ON (tvc.VENUE_ID = tv.ID) LEFT JOIN tbl_VENUE_AGE_XREF tvax ON (tvax.VENUE_ID = tv.ID) LEFT JOIN tbl_VENUE_AGES tvage ON (tvage.PKEY = tvax.VENUE_ID) LEFT JOIN tbl_VENUE_CAPACITY ON (tv.ID

The number of left join in one SQL statement.

2006-06-16 Thread Takanobu Kawabe
Hello, my name is Takanobu Kawabe. I have some questions about left join SQL statement. I want to join some tables, and using left join statement . the system is the following. I use two machines. I created the same databases and tables on both machines. OS : Debian

Re: The number of left join in one SQL statement.

2006-06-16 Thread Barry
Takanobu Kawabe schrieb: Hello, my name is Takanobu Kawabe. こんいちわ孝信さん:) I have some questions about left join SQL statement. I want to join some tables, and using left join statement . the system is the following. I use two machines. I created the same databases

Re: The number of left join in one SQL statement.

2006-06-16 Thread Pooly
Hi, 2006/6/16, Takanobu Kawabe [EMAIL PROTECTED]: [snip] I tried this statement without error. But Ihave some questions. 1.How many left join keywords can I use in one SQL statement if there are 5000 datas in one table? as this blog point out, its 31 or 61 depending

LEFT JOIN Multiple Tables

2006-05-22 Thread Scott Baker
to get the data (since it's optional). SELECT * FROM UserInfo u, DslInfo d LEFT JOIN DslExtra e ON d.DslID = e.DslID LEFT JOIN ExtraAddr a ON a.UserID = u.UserID WHERE u.UserID = d.UserID; However it appears this syntax is not valid in MySQL 5.x (It works on 4.x). I need to LEFT JOIN *two* tables

Re: LEFT JOIN Multiple Tables

2006-05-22 Thread Peter Brawley
Scott SELECT * FROM UserInfo u, DslInfo d LEFT JOIN DslExtra e ON d.DslID = e.DslID LEFT JOIN ExtraAddr a ON a.UserID = u.UserID WHERE u.UserID = d.UserID; However it appears this syntax is not valid in MySQL 5.x Right, as the 5.x docs say, 5.x wants ISO-compatible explicit joins, ie SELECT

Re: LEFT JOIN Multiple Tables

2006-05-22 Thread Scott Baker
Perfect. This is exactly what I needed. Is there some place I get some more documentation on the specifics of the ISO-compatible queries? Might save me some hair-pulling-out in the future. Scott Peter Brawley wrote: Scott SELECT * FROM UserInfo u, DslInfo d LEFT JOIN DslExtra e ON d.DslID

Re: LEFT JOIN Multiple Tables

2006-05-22 Thread Peter Brawley
/join.html). PB - Scott Peter Brawley wrote: Scott SELECT * FROM UserInfo u, DslInfo d LEFT JOIN DslExtra e ON d.DslID = e.DslID LEFT JOIN ExtraAddr a ON a.UserID = u.UserID WHERE u.UserID = d.UserID; However

More LEFT JOIN newbie fun!

2006-05-11 Thread Chris Sansom
, etc... from master_info as r inner join general_info as g left join table_1 as t1 on t1.id = r.id left join table_2 as t2 on t2.id = r.id left join table_3 as t3 on t3.id = r.id left join table_4 as t4 on t4.id = r.id left join table_5 as t5 on t5.id = r.id where g.id

Re: More LEFT JOIN newbie fun!

2006-05-11 Thread Chris Sansom
At 16:09 +0100 11/5/06, I wrote: Not long ago, some highly knowledgeable people here kindly helped me out with a fairly complex query... ... That's all fine and dandy, but now I need to extend this to a further four tables... What I should have added is that for the moment this has to be

Explain explanation (was: More LEFT JOIN newbie fun!)

2006-05-11 Thread Chris Sansom
Following my post about this complex search I'm trying to do... In the initial post I said I'd tried adding: left join table_ga as tga on tga.id = r.id left join table_a as ta on ta.ida = tga.ida or: left join (table_ga as tga inner join table_a as ta) on (tga.id = r.id

  1   2   3   4   5   6   >