我需要从6月到2005年8月底退款。我无法弄清楚如何退回这些付款。我的代码就是我的尝试。
/* Create a list of all the payments made in June, July and August of 2005, and, if they were for a rental, the title of that rental. */
SELECT CONCAT(payment_id,' ',amount) AS Payments
FROM payment
INNER JOIN rental
ON payment.rental_id = rental.rental_id
WHERE payment_date = 2005-06-01 - 2005-08-31;
答案 0 :(得分:1)
尝试在适当使用BETWEEN
运算符
/* Create a list of all the payments made in June, July and August of 2005, and, if they were for a rental, the title of that rental. */
SELECT CONCAT(payment_id,' ',amount) AS Payments
FROM payment
INNER JOIN rental
ON payment.rental_id = rental.rental_id
WHERE payment_date BETWEEN '2005-06-01' AND '2005-08-31';