Re: Joining a table to itself

2008-07-08 Thread Phil
I think you have just got your table names confused. Try this one SELECT cats.CatId, cats.cat As cat, cats1.catid AS catid1, cats1.cat As cat1, cats2.catid AS catid2, cats2.cat AS cat2, cats3.catid AS catid3, cats3.cat AS cat3 FROM vb_ldcats as cats LEFT JOIN vb_ldcats As cats1

RE: Joining a table to itself

2008-07-08 Thread Jim MacDiarmid
Thanks Shannon. :) -Original Message- From: Shannon Wade [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 08, 2008 4:04 PM To: Jim MacDiarmid Subject: Re: Joining a table to itself not sure i understand the order of your table joining i just reordered them and it works. SELECT

Joining a table to itself

2008-07-08 Thread Jim MacDiarmid
I'm hoping someone can help me with this. I have a table of categories that I'm trying to join to itself, but I keep getting the error "unknown column: Cats1.parentid in on clause". Here is the SQL for the table: CREATE TABLE `vb_ldcats` ( `catid`int(10) AUTO_INCREMENT NOT NULL