How can i join three lines into one in unix?

Apologies for the confusing posts..

This is what I want: if "select" found in a line -> delete that line. Delete also the lines afterwards until it finds "update" in a line, but I dont want this line to be deleted, just the line before.

It would be something like:

input:

select <something><something>
update <something><something>
insert into <something><something>
select <something><something>
<something><something>
update <something><something>
select <something><something>
<something><something>
<something><something>
<something><something>
update <something><something> 

output:

update <something><something>
insert into <something><something>
insert into <something><something>
update <something><something> 

That would be: clearing out all the lines with "select" and the lines that goes afterwards until it finds "update", but not deleting the line with "update".
I know I could simply do it like this,

      sed '/^select/,/^update/d' myfile 

but the problem is that I dont want it to delete the line with update, but the line just before when it finds it :s

Thank you,.. I dont know if this is possible. Sorry I was making a mess but there are several ways of getting the final result I want, and I just want to give to you the easiest way to have it done... thanks again

awk '/select/{f=0}/update/{f=1}f' file

given your algorithm and a sample input file provided, I get:

update <something><something>
insert into <something><something>
update <something><something>
update <something><something>

not sure how you arrived at your output.....

Perfect, this does it perfect. I am amazed with the power of awk. Thanks for your help.
So fast answering.. thank you.

---------- Post updated at 02:00 PM ---------- Previous update was at 01:57 PM ----------

Thanks so much, the statement provided by danmero works. I really appreciate your help.

Regards.