Is there a way to have a SQL query automatically update its' parameters based on the results of a previous query?
Here's the scenario I'm trying to achieve:
A report should automatically be run daily that runs the following queries (in order):
- SELECT id of rows that match a certain criteria (we'll call this result set "X")
- SELECT certain fields from rows that are titled "Cancelled-[X]"
- UPDATE rows from [X] with information from "Cancelled-[X]"