![]() With cteDate As (Select Wk=1,DateFrom = Union All Select Wk=DF.Wk+1,DateFrom= DateAdd(DD, -7, df.dateFrom) From cteDate DF Where DF.DateFrom > as (Select RowNr=1,TimeFrom = Union All Select RowNr=Df.RowNr+1,TimeFrom= DateAdd(MINUTE, df.TimeFrom) From cteTime DF Where DF.RowNr < B.*,A. ![]() In this example, 1 query 72 subsets Declare Date = '' No need to run in a loop or even multiple queries. Please suggest how I can do this and apologies for a lengthy (and probably confusing) question. So I want to run above query 12 times for following values of time generated (date part will remain same, only time part will change) 13:17:30 13:22:29 Download (also available on the Mac App Store) NO VIRTUAL MACHINES Tired of having virtual machines eat up your system resources SQLPro for MSSQL is a native Mac application with significant performance and a large feature-set. Is there any way I can run this same query (may be in loop or something) for different values of "time_generated"? For example I want to run this query 12 times to get data between 13:17:30 to 14:17:29 over five minute windows. I have a dirty query that pulls data for past 6 weeks, for same day of the week and same time window of the day. Here is the log when I looped through plates 61.90. All the records are being inserted (10,560 at a time), but SQLPro Studio is still exiting. ![]() ![]() Group & sort are on my list as well, however there are still a few gotchas that I run through my head. The apps are also available as lifetime purchases, however I currently have no promo codes available for that. I have a database table "table_name" in SQL Server 2012 and I am using SQL Server Management Studio version 10.ĭata in table looks like: id create_date update_date time_generated kpname machine_name value_type valueġ0706652 6/23/16 1:08 PM 6/23/16 1:08 PM 6/23/16 1:00 PM Win-RT7_Abc Onetwo_Location BRAABBCCZ02 response_time 18.015ġ0707166 6/23/16 1:13 PM 6/23/16 1:13 PM 6/23/16 1:05 PM Win-RT7_Abc Onetwo_Location BRAABBCCZ02 response_time 18.313ġ0707663 6/23/16 1:18 PM 6/23/16 1:18 PM 6/23/16 1:10 PM Win-RT7_Abc Onetwo_Location BRAABBCCZ02 response_time 18ġ0708157 6/23/16 1:23 PM 6/23/16 1:23 PM 6/23/16 1:15 PM Win-RT7_Abc Onetwo_Location BRAABBCCZ02 response_time 18.328 What is strange is that instead of running through all 500 plates (1.500) I am running in smaller groups 1.30 then 31.60 then 61.90. This link/promo code will allow one year free of most SQLPro (macOS) apps. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |