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