Need to filter SQL database data by time interval (1 sec, 1Min, 10 Min,1Hour, 2Hour) I want filter SQL database data by time interval (1 sec, 1Min, 10 Min,1Hour, 2Hour)
I want to fetch data from "ProDataTable" by in between Start Date and End Date with Interval of (1 Sec, 1Min, 10 Min, 1 Hour , 2 hour)


for Fetching data from Database i am using following query.

Select * 
from ProDataTable
Where Date_Time between '2017-11-17 19:05' AND '2017-11-21 19:23'

So kindly let me know how i can filter out data by time interval (1 sec, 1Min, 10 Min,1Hour, 2Hour).

I want result as follows 
Exa : for 1 Min


Exa : for 1 1hour
From my understanding of your question, you wish to group the data by date and time based on a specified degree of granularity. There is a good article by Steve Stedman which demonstrates how to round a date in T-SQL.

You can use the technique that he pointed out to group by the date to a specific granularity. Based upon your comments you say that you do not wish to apply any aggregation technique to the non-date/time data - this will give you a lot of duplicates based on your example data. To get the result you are looking for I simply apply a DISTINCT across the data set; however if the values of the tags vary you will still get multiple rows per specific date and time.

Example for minute-level granularity:

SELECT DISTINCT Date_Time, Tag1_Value, Tag2_Value, Tag3_Value, Tag4_Value
  FROM (SELECT DATEADD(minute, DATEDIFF(minute, 0, Date_Time), 0) AS Date_Time
             , Tag1_Value, Tag2_Value, Tag3_Value, Tag4_Value
         FROM ProDataTable
        WHERE Date_Time BETWEEN '2017-11-17 19:05' AND '2017-11-21 19:23') AS a
GROUP BY Date_Time, Tag1_Value, Tag2_Value, Tag3_Value, Tag4_Value
ORDER BY Date_Time