Seperation query for green up and down table