deleyd
asked on
SQL query in one statement or many?
I'm Analyzing / Reverse Engineering some query statements already written. I see it's currently being done in stages, where first there's a SELECT into a table (a permanent table but only used for temporary use as far as I can tell), then there's a second SELECT into another (permanent temporary) table, pulling data from the first table, joining with other tables. Then there's a third SELECT statement, pulling data from the second table joining with other tables. Then there's some filtering out of rows from that third temporary table, and finally the procedure creats the output table we wanted.
Question 1: In theory, is it always possible to fetch any table using just one massive SELECT statement?
Question 2: Would a single massive SELECT statement be any better? Faster? Easier or more difficult to maintain and document?
Question 1: In theory, is it always possible to fetch any table using just one massive SELECT statement?
Question 2: Would a single massive SELECT statement be any better? Faster? Easier or more difficult to maintain and document?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.