SitePoint Sponsor

User Tag List

Results 1 to 1 of 1
  1. #1
    SitePoint Addict ruba's Avatar
    Join Date
    Apr 2005
    Location
    Amman -Jordan
    Posts
    339
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question where clause is ambiguous error

    Hi every body
    I read this lesson how to make inherit in MySQL

    http://dev.mysql.com/tech-resources/...ical-data.html

    I make my own table
    CREATE TABLE IF NOT EXISTS `jos_vm_category_xref` (
    `category_parent_id` int(11) NOT NULL default '0',
    `category_child_id` int(11) NOT NULL default '0',
    `category_list` int(11) default NULL,
    PRIMARY KEY (`category_child_id`),
    KEY `category_xref_category_parent_id` (`category_parent_id`),
    KEY `idx_category_xref_category_list` (`category_list`)
    ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Category child-parent relation list';


    and I run this query
    SELECT t1.category_child_id AS lev1, t2.category_child_id AS lev2, t3.category_child_id AS lev3, t4.category_child_id AS lev4
    FROM jos_vm_category_xref AS t1
    LEFT JOIN jos_vm_category_xref AS t2 ON t2.category_child_id = t1.category_parent_id
    LEFT JOIN jos_vm_category_xref AS t3 ON t3.category_child_id = t2.category_parent_id
    LEFT JOIN jos_vm_category_xref AS t4 ON t4.category_child_id = t3.category_parent_id
    WHERE category_parent_id =56



    this error appear
    #1052 - Column 'category_parent_id' in where clause is ambiguous

    what is the problem , any body can help me ?


    TANKS EVERY BODY I SOLVED THE PROBLE IT WAS IN WHERE category_parent_id =56 IT MUST BE T1.category_parent_id =56
    Last edited by ruba; Dec 17, 2008 at 02:29. Reason: I Find the probelm
    Open Blocked website
    Open Blocked Website
    Knowledge Is Knowing That A Tomato Is A Fruit,
    Wisdom Is Not Putting It In A Fruit Salad.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •