Re: [PHP-DB] Left Join

2011-08-07 Thread Peter Lind
Maybe it's just me, but I can't see anything that would work as foreign key for you to join on - neither table seems to have a foreign key On 7 August 2011 21:53, Chris Stinemetz chrisstinem...@gmail.com wrote: I am tyring to build a query that will take the most recent stores.store_date column

Re: [PHP-DB] Left Join

2011-08-07 Thread Chris Stinemetz
On Sun, Aug 7, 2011 at 3:00 PM, Peter Lind peter.e.l...@gmail.com wrote: Maybe it's just me, but I can't see anything that would work as foreign key for you to join on - neither table seems to have a foreign key Sorry for my ignorance. How do I create the foreign key? The two columns from

RE: [PHP-DB] Left Join

2011-08-07 Thread Toby Hart Dyke
@lists.php.net Subject: Re: [PHP-DB] Left Join On Sun, Aug 7, 2011 at 3:00 PM, Peter Lind peter.e.l...@gmail.com wrote: Maybe it's just me, but I can't see anything that would work as foreign key for you to join on - neither table seems to have a foreign key Sorry for my ignorance. How do I create

Re: [PHP-DB] Left Join with more than two tables......

2003-08-14 Thread Brent Baisley
The left join works the same for two or more tables. select * from table1 left join table2 on table1.id=table2.id left join table3 on table1.id=table3.id ... Just specify the table you want to join and what to use to join them. On Tuesday, August 12, 2003, at 03:16 PM, Michael Cortes wrote: I

Re: [PHP-DB] Left Join with more than two tables......

2003-08-14 Thread Michael Cortes
Thanks. I couldn't find the correct syntax in my resources. I tried at one point to use commas like: select * from table1 left join table2,table3 on table1.id=table2.id,table1.id=table3.id Thanks again for the correct syntax. On Tuesday 12 August 2003 04:00 pm, Brent Baisley wrote: The left

Re: [PHP-DB] LEFT JOIN not working

2003-01-15 Thread Ignatius Reilly
: Re: [PHP-DB] LEFT JOIN not working Still not working. I made the change, and I'm still getting all results. I even tried it without the leading '0' in front of the 1, no good. Here's my current query, with suggested changes: SELECT ads_displayrate.name, SUM(ads_displayrate.count) as display

Re: [PHP-DB] LEFT JOIN not working

2003-01-14 Thread Lisi
fields). HTH Ignatius - Original Message - From: Lisi [EMAIL PROTECTED] To: Ignatius Reilly [EMAIL PROTECTED] Sent: Thursday, January 09, 2003 6:54 PM Subject: Re: [PHP-DB] LEFT JOIN not working Cool! It's mostly working now, the only problem

Re: [PHP-DB] LEFT JOIN not working

2003-01-14 Thread Miles Thompson
- Original Message - From: Lisi [EMAIL PROTECTED] To: Ignatius Reilly [EMAIL PROTECTED] Sent: Thursday, January 09, 2003 6:54 PM Subject: Re: [PHP-DB] LEFT JOIN not working Cool! It's mostly working now, the only problem is it's ignoring the other clauses

Re: [PHP-DB] LEFT JOIN not working

2003-01-09 Thread Ignatius Reilly
problem 1: move the WHERE clauses to the ON clauses problem 2: Obviously your intent with COUNT(ads_clickrate.date) is to count the number of non-null occurences of click. But COUNT() is not the appropriate function to do this (it will simply give you the number of rows inside a group). Try

Re: [PHP-DB] LEFT JOIN not working

2003-01-09 Thread Ignatius Reilly
, such as an id, unique and required, instead of name) Ignatius - Original Message - From: Lisi [EMAIL PROTECTED] To: Ignatius Reilly [EMAIL PROTECTED]; PHP-DB [EMAIL PROTECTED] Sent: Thursday, January 09, 2003 12:18 PM Subject: Re: [PHP-DB] LEFT JOIN

Re: [PHP-DB] LEFT JOIN not working

2003-01-09 Thread Ignatius Reilly
. Ivester, CEO, Coca Cola - Original Message - From: Lisi [EMAIL PROTECTED] To: Ignatius Reilly [EMAIL PROTECTED]; PHP-DB [EMAIL PROTECTED] Sent: Thursday, January 09, 2003 1:11 PM Subject: Re: [PHP-DB] LEFT JOIN not working Exactly my question - why

Re: [PHP-DB] LEFT JOIN not working

2003-01-09 Thread Ignatius Reilly
] Sent: Thursday, January 09, 2003 6:54 PM Subject: Re: [PHP-DB] LEFT JOIN not working Cool! It's mostly working now, the only problem is it's ignoring the other clauses in the ON clause that select the desired date. Perhaps it's not supposed to be connected this way? How would I select

Re: [PHP-DB] Left Join is producing duplicate results - MySQL relational tables

2001-07-12 Thread Dobromir Velev
Hi, Did you try to use something like this. mysql_query(SELECT DISTINCT WLPbib.bibID, WLPbib.title, WLPbib.publisher, WLPbib.publicationDate, WLPaddress.city, WLPaddress.state, WLPprofile.firstName,

RE: [PHP-DB] Left Join is producing duplicate results - MySQL relational tables

2001-07-12 Thread Matthew Loff
! -Original Message- From: Dobromir Velev [mailto:[EMAIL PROTECTED]] Sent: Thursday, July 12, 2001 3:01 AM To: [EMAIL PROTECTED]; Mike Gifford Subject: Re: [PHP-DB] Left Join is producing duplicate results - MySQL relational tables Hi, Did you try to use something like this. mysql_query(SELECT

Re: [PHP-DB] Left Join is producing duplicate results - MySQL relational tables

2001-07-12 Thread Mike Gifford
I've expanded the code. Mike -Original Message- From: Dobromir Velev [mailto:[EMAIL PROTECTED]] Sent: Thursday, July 12, 2001 3:01 AM To: [EMAIL PROTECTED]; Mike Gifford Subject: Re: [PHP-DB] Left Join is producing duplicate results - MySQL relational tables Hi, Did you try

RE: [PHP-DB] Left Join is producing duplicate results - MySQL relational tables

2001-07-12 Thread Matthew Loff
To: Matthew Loff Cc: 'Dobromir Velev'; [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re: [PHP-DB] Left Join is producing duplicate results - MySQL relational tables Hi Matthew, Matthew Loff wrote: What about... SELECT WLPbib.bibID, WLPbib.title, WLPbib.publisher

Re: [PHP-DB] Left Join is producing duplicate results - MySQL relational tables

2001-07-11 Thread Ken
Mike - I'm not certain but it sounds like you might be looking for GROUP BY. Do GROUP BY and then the columns that are identical in your results. - Ken At 09:46 PM 7/11/01 -0400, Mike Gifford wrote: Hello, I posted this to the general list this morning got a couple of good leads, but they

Re: [PHP-DB] Left Join is producing duplicate results - MySQL relational tables

2001-07-11 Thread Ken
Mike - In general, you should always be reading the manual first. From the SELECT syntax at http://www.mysql.com/doc/S/E/SELECT.html GROUP BY must be indicated before ORDER BY. So reverse the order of those portions. - Ken At 10:35 PM 7/11/01 -0400, Mike Gifford wrote: It looked good, but it

Re: [PHP-DB] Left Join is producing duplicate results - MySQL relational tables

2001-07-11 Thread Mike Gifford
Sorry Ken, I'm trying to learn a few too many things at once. Switching it around eliminated the error message but not the duplication. I'm eliminating as much of the code as I can to see that it isn't coming from PHP. Thanks again for your help. Mike Ken wrote: In general, you should

Re: [PHP-DB] Left Join is producing duplicate results - MySQL relational tables

2001-07-11 Thread Kevin Johnson
[EMAIL PROTECTED] To: Ken [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Wednesday, July 11, 2001 08:00 PM Subject: Re: [PHP-DB] Left Join is producing duplicate results - MySQL relational tables Sorry Ken, I'm trying to learn a few too many things at once. Switching it around eliminated

RE: [PHP-DB] Left Join is producing duplicate results - MySQL relational tables

2001-07-11 Thread Beau Lebens
Beau // -Original Message- // From: Mike Gifford [mailto:[EMAIL PROTECTED]] // Sent: Thursday, 12 July 2001 11:01 AM // To: Ken // Cc: [EMAIL PROTECTED] // Subject: Re: [PHP-DB] Left Join is producing duplicate // results - MySQL // relational tables // // // Sorry Ken, // // I'm

Re: [PHP-DB] Left Join is producing duplicate results - MySQL relational tables

2001-07-11 Thread Mike Gifford
Message- // From: Mike Gifford [mailto:[EMAIL PROTECTED]] // Sent: Thursday, 12 July 2001 11:01 AM // To: Ken // Cc: [EMAIL PROTECTED] // Subject: Re: [PHP-DB] Left Join is producing duplicate // results - MySQL // relational tables // // // Sorry Ken, // // I'm trying to learn