Writing a routine to create sequential records

后端 未结 3 877
南旧
南旧 2021-01-16 21:11

I would like to write a routine which will allow me to take dated events (records) in a table which span accross a set time frame and in the cases where no event took place

3条回答
  •  無奈伤痛
    2021-01-16 21:38

    With no details about your specifics (table schema, available language options etc), iI guess that you just need the algorithm to pick up. So here's a quick algorithm with no safeguards.

    properdata = "select * from data where eventHasTakenPlace=true";
    wrongdata = "select * from data where eventHasTakenPlace=false";
    for each wrongRecord in wrongdata {
        exampleRecord = select a.value1, a.value2,...,a.date from properdata as a 
        inner join
        (select id,max(date)
         from properdata
         group by id
         having date
                                                            
提交回复
热议问题