Great David, many thanks. I just solve another problem with the code. Thank you very much for the information. Now the iip is not an alias of items, the past programmer type it wrong. I was able to get all of the errors out too.
Thanks -- - Louie Miranda http://www.axishift.com ----- Original Message ----- From: "David Griffiths" <[EMAIL PROTECTED]> To: "Louie Miranda" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Friday, June 04, 2004 3:44 PM Subject: Re: What does this sql query mean? > Louie, > > The inner-join is just joining the two tables, shopcart and items. > > I think iip is an alias for items, but the alias would normally come > after the name of the tiems table. Another way to write the query is > (assuming iip is an alias for items), > > SELECT * FROM shopcart, items iip > WHERE shopcart.itemID = iip.itemID > AND shopcart.cookieId = '4bfa673ee4c544d4352e2c70a78b70b5' > order by iip.itemName asc > > > The inner-join is just an alternative to what's above. > > I read on some site that there were two advantages: > > 1) Kept the the WHERE-clause a bit simpler > 2) Was a bit faster, as the tables were pre-matched; I doubt this, and > the source wasn't particularily trustworth. The MySQL manual doesn't > mention any performance gains from using the INNER-JOIN functionality > > Here's the relevant MySQL manual page: > http://dev.mysql.com/doc/mysql/en/JOIN.html > > The relevant section: > > "INNER JOIN and , (comma) are semantically equivalent in the absence of > a join condition: both will produce a Cartesian product between the > specified tables (that is, each and every row in the first table will be > joined onto all rows in the second table)." > > By comma, they mean the comma seperating the two tables in the FROM > clause, as I've written it above (FROM shopcart, items). > > David > > > Louie Miranda wrote: > > >Hi, > > > >Im just a new comer on mysql and i was in the middle of debugging some codes > >that aint mine. I was stuck here. I could not figure what does this select > >do? > > > >Its complicated.. > > > >Can anyone help me out? > > > >select * from shopcart inner join items on shopcart.itemId = iip.itemId > >where shopcart.cookieId = '4bfa673ee4c544d4352e2c70a78b70b5' order by > >iip.itemName asc > > > >Thanks > > > >-- - > >Louie Miranda > >http://www.axishift.com > > > > > > > > > > > > > -- > MySQL General Mailing List > For list archives: http://lists.mysql.com/mysql > To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED] > > -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]