Results 1 to 3 of 3

Thread: Why is the MySQL query giving me this?

  1. #1
    anicolais is offline Senior Member
    Join Date
    Nov 2009
    Posts
    99

    Default Why is the MySQL query giving me this?

    This is my query:
    SELECT accounts_cstm.result_status_c AS 'Result Status', accounts_cstm.result_status_date_c AS 'Result Status Date', accounts.name AS 'Company Name', accounts.billing_address_city AS 'Company City', accounts.billing_address_state AS 'Company State', contacts.last_name AS 'Contact Name', contacts.phone_work AS 'Contact Phone', "" AS 'Email', (contacts_cstm.appointment_set_c + contacts_cstm.time_and_timezone_c) AS 'Appointment', accounts_cstm.list_source_c AS 'List Source', accounts_cstm.primary_markets_c AS 'Primary Markets', accounts_cstm.company_size_c AS 'Company Size', accounts_cstm.actual_result_c AS 'Actual Result', accounts_cstm.dollar_amount_c AS 'Dollar Amount', notes.description AS 'Notes'
    FROM contacts LEFT JOIN accounts_contacts ON contacts.id = accounts_contacts.contact_id
    LEFT JOIN accounts ON accounts.id = accounts_contacts.account_id
    LEFT JOIN accounts ON accounts.id = accounts_cstm.id_c
    LEFT JOIN contacts ON contacts.id = contacts_cstm.id_c
    Left Join contacts on contacts.id = notes.id

    Its giving me Not unique table/alias: 'accounts' Huh???????

    Sugar 5.5
    MySQL

  2. #2
    Angel's Avatar
    Angel is offline Sugar Community Member
    Join Date
    Jul 2005
    Location
    Los Angeles
    Posts
    4,813

    Default Re: Why is the MySQL query giving me this?

    Quote Originally Posted by anicolais View Post
    This is my query:

    LEFT JOIN accounts ON accounts.id = accounts_cstm.id_c
    LEFT JOIN contacts ON contacts.id = contacts_cstm.id_c

    Its giving me Not unique table/alias: 'accounts' Huh???????

    Sugar 5.5
    MySQL
    The above should be JOIN accounts_cstm and JOIN contacts_cstm

    Also, you are joining the contacts table in your last line, although your original FROM is on the contacts table. I think what you want in that case is a JOIN notes.
    Regards,

    Angel Magaņa
    Co-Author: Implementing SugarCRM 5.x (Packt Publishing -- Sept. 2010)
    Blog: http://cheleguanaco.blogspot.com.
    Twitter: @cheleguanaco.

    ________
    | Projects: |_____________________________________
    |
    | CandyWrapper (.NET Wrapper for SugarCRM SOAP API). Source now available on GitHub!
    | GoldMine to SugarCRM Express Conversion. Latest: 1.0.1.7 (Nov. 3, 2009)
    | CRM SkyDialer (Skype Integration). Latest: 1.0.2 (Feb. 17, 2010)
    | Round Robin Leads Assignment
    | Phone Number Formatter
    | CaseTwit (Twitter Integration)
    ______________________________________________

  3. #3
    anicolais is offline Senior Member
    Join Date
    Nov 2009
    Posts
    99

    Default Re: Why is the MySQL query giving me this?

    Wowww duhh definitely staring at this way to long today....Thank you very much!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 7
    Last Post: 2011-08-18, 01:48 PM
  2. Replies: 2
    Last Post: 2008-10-20, 06:01 AM
  3. Query Failed: ::MySQL error 1065: Query was empty
    By darcy.rippon in forum Developer Help
    Replies: 3
    Last Post: 2008-10-10, 07:24 AM
  4. Replies: 2
    Last Post: 2006-10-20, 12:00 AM
  5. Query Failed: ::MySQL error 1065: Query was empty
    By suruchi in forum Developer Help
    Replies: 1
    Last Post: 2006-01-21, 03:16 PM

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
  •