I'm trying to join some tables, using the phpMyAdmin screens from my control panel, I run the following query:

SELECT dealers.dealerName, address2Rel.reladdress2Id FROM dealers LEFT JOIN address2Rel ON dealers.dealerId = address2Rel.reldealerId LEFT JOIN addresses2.address2 ON address2Rel, addresses2 where addresses2.address2Id = address2Rel.reladdress2Id

It returns the error:

MySQL said:

select command denied to user: user@ for table address2

(I've substituted user for the actual username.)

My questions:
1) table address2 does not exist. IT was originally created, then renamed, then dropped completely. I replaced it with addresses2

2) why is the select command denied?

Simple select commands work fine. Is this a syntax error or a permission error?

Thanks,
Steve

    Could this be the problem? You have this in your SQL statement

    LEFT JOIN addresses2.address2

    instead of

    LEFT JOIN addresses2

      No, that didn't work either:

      quote:

      LEFT JOIN addresses2

      yields Not unique table/alias: 'addresses2'

      I'm trying to essentially list all records. Following Barry Wise's normalization article techniques, I have the following tables:
      dealers:
      dealerId, dealerName

      addressRel:
      reldealerId, reladdressId

      addresses:
      addressesId, address

      address2Rel:
      reldealerId, reladdresses2Id

      addresses2
      addresses2Id, address2

      Not all dealers will have an address2. I want to list the dealerName, address, address2, even if a particular dealer does not have an address2.

      How do I join this many tables?

        Write a Reply...