Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Express Edition and Compact Edition (2005)
 INNER JOIN

Author  Topic 

programer
Posting Yak Master

221 Posts

Posted - 2010-08-20 : 16:18:52
Hi,

This query not works:
string queryString = "SELECT PaymentId, AttributeName,Value from tbl_PaymentDetails INNER JOIN tbl_Payments ON tbl_Payments.PaymentId= tbl_PaymentDetails.PaymentId WHERE ATTRIBUTENAME IN ('" + strCardNumberAttributeName +
"','" + strExpiryDateAttributeName + "')";


Error:
Ambiguous column name 'PaymentId'.

I don't know why not works

Please help

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2010-08-20 : 16:28:44
Change "SELECT PaymentID" to "SELECT tbl_Payments.PaymentID".



N 56°04'39.26"
E 12°55'05.63"
Go to Top of Page

programer
Posting Yak Master

221 Posts

Posted - 2010-08-20 : 17:16:00
quote:
Originally posted by Peso

Change "SELECT PaymentID" to "SELECT tbl_Payments.PaymentID".



N 56°04'39.26"
E 12°55'05.63"




thanks, now it works!
Go to Top of Page
   

- Advertisement -