0

HI I have a MYSQL Query which has a long response time. I have a table for_reg_users which has different fields like first name, last name and date visited. I run the query to get records which are new( i-e: before particular time period they do not have a entry and the record should be unique so the first name and last name is combined). Can this query be written in different way so that the response time is less. Thanks in advance.

Query = SELECT * FROM `for_reg_users` where `date_visited` BETWEEN '2012-05-01' AND '2012-05-31' AND CONCAT(first_name, ' ', last_name) NOT IN ( SELECT CONCAT(first_name, ' ', last_name) from `for_reg_users` where `date_visited` < '2012-05-01') AND `deleted` = '0';

1 Answer 1

1
Query = SELECT DISTINCT(CONCAT(first_name, ' ', last_name)) , * FROM `for_reg_users` where `date_visited` <= '2012-05-31' and deleted = 0
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.