Adding previous query table