我想用多个条件查询联接两个表
string sql = "Select l.*, c.FirstName_CompanyName from dbo.Loan l left join Customer c on l.CustId=c.CustId where LoanAccountNo > 0 ";
当我实现上面的代码,但我发现我需要过滤贷款表批准和删除,但我似乎不能得到它的权利。
下面的代码是我尝试过但不起作用的代码
string sql = "Select l.*, c.FirstName_CompanyName from dbo.Loan WHERE Delete = 0 AND Approve = 1 l left join Customer c on l.CustId=c.CustId where LoanAccountNo > 0 ";
{"Incorrect syntax near the keyword 'Delete'."}
1条答案
按热度按时间1tu0hz3e1#
请使用下面的代码,代码中存在类型错误,您在贷款表和别名l之间添加了删除dna批准条件