SQL中AND运算符的用途是什么?如何在下面的查询中使用AND


SELECT 
c.LastName, 
c.FirstName, 
i.InvoiceId, 
i.CustomerId, 
i.InvoiceDate, 
i.BillingCity,
i.total  
FROM 
invoices i 
INNER JOIN 
customers c ON i.CustomerId = c.CustomerId 
WHERE 
BillingCity LIKE 'P%' 
OR Billingcity NOT LIKE 'D%' 

我想知道AND运算符的用途是什么,以及我如何在上面的查询中使用AND来查找花费了10美元的纽约客户?

使用此:

SELECT 
c.LastName, 
c.FirstName, 
i.InvoiceId, 
i.CustomerId, 
i.InvoiceDate, 
i.BillingCity,
i.total  
FROM 
invoices i 
INNER JOIN 
customers c ON i.CustomerId = c.CustomerId 
WHERE 
i.BillingCity = 'New York' AND i.total = 10

相关内容

最新更新