This SO post details some benefits in performance regarding Derived vs. Temporary tables.
Other than performance, what situations exist for which a Derived table would not be appropriate.
One answer per post with an example would be helpful.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I would prefer to do a self-join on a temporary table than a derived table.
Versus using a derived table, where you have to write the whole query twice:
But another solution is to use common table expressions which are slightly different from derived tables:
Provided you use a brand of database that supports this syntax (Microsoft, Oracle, IBM, PostgreSQL).