By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,265 Members | 1,343 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,265 IT Pros & Developers. It's quick & easy.

Need help with error on JOIN statement

P: 2
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))
Sep 24 '08 #1
Share this Question
Share on Google+
3 Replies


code green
Expert 100+
P: 1,726
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
  1. from AST_CMDB_Associations aca, AST_ComputerSystem, AST_AssetWarranty
  2. INNER JOIN AST_ComputerSystem ON AST_ComputerSystem.Reconciliation_Identity = aca.Request_ID01
  3. INNER JOIN AST_CMDB_Associations acma ON AST_AssetWarranty.instanceId = 
  4.  
Or something along those lines
Sep 24 '08 #2

iburyak
Expert 100+
P: 1,017
Try this:

Expand|Select|Wrap|Line Numbers
  1. UPDATE AST_ComputerSystem 
  2. SET AST_ComputerSystem.Supported = '1' 
  3. from AST_AssetWarranty
  4. INNER JOIN AST_CMDB_Associations ON AST_AssetWarranty.instanceId = AST_CMDB_Associations.Request_ID02 
  5. INNER JOIN AST_ComputerSystem ON AST_ComputerSystem.Reconciliation_Identity = AST_CMDB_Assocations.Request_ID01
  6. WHERE(AST_AssetWarranty.Expiration_Date > Currentdate)
Good Luck.
Sep 24 '08 #3

P: 2
That did it! Thanks so much for the help.


Try this:

Expand|Select|Wrap|Line Numbers
  1. UPDATE AST_ComputerSystem 
  2. SET AST_ComputerSystem.Supported = '1' 
  3. from AST_AssetWarranty
  4. INNER JOIN AST_CMDB_Associations ON AST_AssetWarranty.instanceId = AST_CMDB_Associations.Request_ID02 
  5. INNER JOIN AST_ComputerSystem ON AST_ComputerSystem.Reconciliation_Identity = AST_CMDB_Assocations.Request_ID01
  6. WHERE(AST_AssetWarranty.Expiration_Date > Currentdate)
Good Luck.
Sep 24 '08 #4

Post your reply

Sign in to post your reply or Sign up for a free account.