sql - Last 10 days Values based on Last available data -



sql - Last 10 days Values based on Last available data -

i have fetch info table in such way start date fetch info based on date lastly info inserted.

for illustration have info 24/01/2011 now. specific id have inserted lastly info on 24/01/2012. in case id have fetch info 14/01/2012 24/01/2012.

because don't know lastly date when info inserted , first have fetch max of date , based on can find start date. there fast way that. handled in single , fast query.

if understand question, reply may this:

select * table_1 t1 table_1.start_date >= to_date('14/01/2012', 'dd-mm-yyyy') , table_1.start_date <= (select max(t11.insert_date) table_1 t11 t1.id = t11.id)

sql firebird

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -