I’m new to using BETWEEN in a WHERE clause, so hopefully someone more experienced can tell me if the following is correct:
UPDATE users SET account_status = 1 WHERE user_created_at BETWEEN :begin_date AND :end_date AND id_user > 3000.
What I want is for the query to set a user’s account status to 1 if the user_created_at is between two different dates, and the id of the user is above 3000. But there are a lot of ANDs here. I guess mysql will recognize the first AND after a BETWEEN statement to point toward the first arg of BETWEEN and the second arg of BETWEEN. Or are additional ANDs factored into the BETWEEN, or are they just added to the WHERE clause in general? I tried the above query and it appeared to work, but I want to avoid side effects later on due to a lack of understanding of BETWEEN and adding additional args to the WHERE clause.