javasqlnetbeansdifference-between-rows

I need SQL query to find between two date and another column by name


SELECT * 
FROM claz 
WHERE student AND (BETWEEN date AND date) 

I have this one table claz, and I need to search to find student records between date periods


Solution

  • You may try to use it like this:

    SELECT *  
    FROM claz  
    WHERE student = 'somevalue'
      AND date_column BETWEEN '2013/02/25' AND '2013/02/27'
    

    or like this:

    SELECT *  
    FROM claz  
    WHERE student = 'somevalue'
      AND date_column >'2013/02/25' AND date_column <'2013/02/27'
    

    But it not very clear what you are trying to achieve