Earlier I asked how I could join two tables to match records from two tables and was able to pull the records that I wanted however I have a list of categories and each category can belong to another category, so lets say category 1 can have many subcategories so I need to get the name of the parent category, if I have a table with the structure:
Code:
categories ( id=the id of the category, name=the name of the category, parentcategory=the id of the parent category stored in this same table )
SO I want to run a query that gives me id, name, parentcategoryid and parentcategoryname, I ran this query
Code:
SELECT e70n2_tlakcalendarcategories . * , e70n2_users.id AS user_id, e70n2_users.username AS created_un
FROM e70n2_tlakcalendarcategories
INNER JOIN e70n2_users ON e70n2_users.id = e70n2_tlakcalendarcategories.created_by
INNER JOIN e70n2_tlakcalendarcategories ON e70n2_tlakcalendarcategories.id = e70n2_tlakcalendarcategories.catid
but I get: Not unique table/alias: 'e70n2_tlakcalendarcategories'
I am trying to get the parent's category name with an alias so I can then identify it properly
Bookmarks