Help | Site Map
Connecting Tech Pros Worldwide
Reply
 
LinkBack Thread Tools
  #1  
Old September 24th, 2008, 01:59 PM
Newbie
 
Join Date: Sep 2008
Posts: 2
Default Need help with error on JOIN statement

I get the following error when running the query below:

Tables or functions 'AST_CMDB_Associations' and 'AST_CMDB_Associations' have the same exposed names. Use correlation names to distinguish them.

I have looked up information regarding correlation names but it just doesn't make sense to me. It's obvious I don't really know what I am doing. Can anyone help? Thanks in advance.

UPDATE AST_ComputerSystem
SET AST_ComputerSystem.Supported = '1'
from AST_CMDB_Associations, AST_ComputerSystem, AST_AssetWarranty
INNER JOIN AST_ComputerSystem ON AST_ComputerSystem.Reconciliation_Identity = AST_CMDB_Assocations.Request_ID01
INNER JOIN AST_CMDB_Associations ON AST_AssetWarranty.instanceId =
AST_CMDB_Associations.Request_ID02
WHERE((AST_AssetWarranty.Expiration_Date >Currentdate))
Reply
  #2  
Old September 24th, 2008, 03:02 PM
code green's Avatar
Expert
 
Join Date: Mar 2007
Posts: 836
Default

Must admit not familiar with this one.
But at a guess it is likely because you have JOINed to the same table.
Nothing wrong with that but you need to alias them both,
then refer to the alias in the table.fieldname prefix
Expand|Select|Wrap|Line Numbers
    from AST_CMDB_Associations aca, AST_ComputerSystem, AST_AssetWarranty INNER JOIN AST_ComputerSystem ON AST_ComputerSystem.Reconciliation_Identity = aca.Request_ID01 INNER JOIN AST_CMDB_Associations acma ON AST_AssetWarranty.instanceId =
Or something along those lines
Reply
  #3  
Old September 24th, 2008, 03:23 PM
iburyak's Avatar
Expert
 
Join Date: Nov 2006
Posts: 1,013
Default

Try this:

Expand|Select|Wrap|Line Numbers
    UPDATE AST_ComputerSystem SET AST_ComputerSystem.Supported = '1' from AST_AssetWarranty INNER JOIN AST_CMDB_Associations ON AST_AssetWarranty.instanceId = AST_CMDB_Associations.Request_ID02 INNER JOIN AST_ComputerSystem ON AST_ComputerSystem.Reconciliation_Identity = AST_CMDB_Assocations.Request_ID01 WHERE(AST_AssetWarranty.Expiration_Date > Currentdate)
Good Luck.
Reply
  #4  
Old September 24th, 2008, 05:32 PM
Newbie
 
Join Date: Sep 2008
Posts: 2
Default

That did it! Thanks so much for the help.


Quote:
Originally Posted by iburyak
Try this:

Expand|Select|Wrap|Line Numbers
    UPDATE AST_ComputerSystem SET AST_ComputerSystem.Supported = '1' from AST_AssetWarranty INNER JOIN AST_CMDB_Associations ON AST_AssetWarranty.instanceId = AST_CMDB_Associations.Request_ID02 INNER JOIN AST_ComputerSystem ON AST_ComputerSystem.Reconciliation_Identity = AST_CMDB_Assocations.Request_ID01 WHERE(AST_AssetWarranty.Expiration_Date > Currentdate)
Good Luck.
Reply
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles