Re: Join Statement

2009-12-14 Thread Victor Subervi
On Mon, Dec 14, 2009 at 1:04 PM, Peter Brawley wrote: > ...on t.ProdID-p.ID... _subtracts_ the two IDs. To match them use '=' > rather than '-'. > Thank you for all of you that caught that. V

Re: Join Statement

2009-12-14 Thread Peter Brawley
Victor, > I beg to differ: > mysql> select SKU, Quantity, Name, Price, p.sizes, > p.colorsShadesNumbersShort from tem126080739853 t join products p on > t.ProdID-p.ID ; ...on t.ProdID-p.ID... _subtracts_ the two IDs. To match them use '=' rather than '-'. PB - Vic

Re: Join Statement

2009-12-14 Thread Mark Goodge
Victor Subervi wrote: On Mon, Dec 14, 2009 a mysql> select SKU, Quantity, Name, Price, t.sizes, t.colorsShadesNumbersShort from tem126080739853 t join products p on t.ProdID-p.ID ; Empty set (0.00 sec) mysql> select ID, SKU, Name, Price from products; ++--+---

RE: Join Statement

2009-12-14 Thread Steven Staples
Victor, As far as I can see... change the '-' to '='. <-- fixed query --> SELECT SKU , Quantity , Name , Price , p.sizes , p.colorsShadesNumbersShort FROM tem126080739853 t JOIN products p ON t.ProdID = p.ID ; <-- end -->

Re: Join Statement

2009-12-14 Thread Shawn Green
Victor Subervi wrote: On Mon, Dec 14, 2009 at 12:37 PM, Peter Brawley wrote: > ... on t.ProdID-p.ID; Your join clause subtracts the two IDs, so it's on IDs that differ, and apparently there aren't any. I beg to differ: ... So why does my select join fail? TIA, V It fails because you

Re: Join Statement

2009-12-14 Thread Victor Subervi
On Mon, Dec 14, 2009 at 12:37 PM, Peter Brawley wrote: > > ... on t.ProdID-p.ID; > > Your join clause subtracts the two IDs, so it's on IDs that differ, and > apparently there aren't any. > I beg to differ: mysql> select SKU, Quantity, Name, Price, p.sizes, p.colorsShadesNumbersShort from tem1

Re: Join Statement

2009-12-14 Thread Peter Brawley
> ... on t.ProdID-p.ID; Your join clause subtracts the two IDs, so it's on IDs that differ, and apparently there aren't any. PB - Victor Subervi wrote: Hi; I have the following: mysql> select SKU, Quantity, Name, Price, p.sizes, p.colorsShadesNumbersShort from tem126080739853 t join pr

RE: JOIN Statement on 2 Database Tables?

2003-09-17 Thread Keith Hamilton
Figged it would be easy enuf. Thanks -- Keith -Original Message- From: Chris Boget [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 17, 2003 9:38 AM To: Keith Hamilton; MySQL Subject: Re: JOIN Statement on 2 Database Tables? > Is it possible to Join 2 tables in 2 differ

Re: JOIN Statement on 2 Database Tables?

2003-09-17 Thread Chris Boget
> Is it possible to Join 2 tables in 2 different databases? Can someone > give a quick example? select database1.table1.* from database1.table1, database2.table2 where database1.table1.common_field = database2.table2.common_field. Chris -mysql,query,blah -- MySQL General Mailing List For lis

RE: Join Statement

2003-04-03 Thread Chris Blake
Thanks for tip, I`ve been doing a bit of reading up and have solved the problem. Your advice will be stored for future reference, thanks. On Wed, 2003-04-02 at 21:31, Michael Shulman wrote: > You can't use a JOIN on an insert, only on a SELECT. > > The (simplest) syntax for INSERT is > > INS

RE: Join Statement

2003-04-02 Thread Michael Shulman
You can't use a JOIN on an insert, only on a SELECT. The (simplest) syntax for INSERT is INSERT INTO (col1, col2, col3) VALUES (val1, val2, val3) You can also INSERT as a result of a SELECT, but that's not what you want. Unfortunately, you will need to create multiple INSERT statements to kee