mysql query with several filters

0

I have this query in MySQL and I would like to know if it is possible to make the following queries with this query:

  • at least for the date range

  • for a start date without providing the final date

  • only by first name, last name, personal_id or by iteractions.title

  • filter by name and iteractions.title by adding or not a range of date

  • Note: this query is by way of example since I have not been able to find one that does all the tasks I want and may have some errors.

    SELECT  title,
            result, 
            first_name,
            last_name,
            id_personal,
            iteractions.create_date as create_date, 
            iteractions.id as id_iteraction,
            clients_profile.id as id_client_profile 
    FROM 
            clients_profile left join iteractions on clients_profile.id = iteractions.id_client_profile 
    WHERE 
            first_name = 'delvin' OR
            last_name = '' OR
            id_personal = '' OR
            iteractions.title= '' OR
            iteractions.create_date BETWEEN '2017-10-23 00:00:00' AND  '2017-10-23 23:59:59';
    
        
    asked by Julio Vasquez 26.10.2017 в 18:45
    source

    0 answers