Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

What is a CTE (Common Table Expression), and how is it different from a subquery?

Answer Posted / hr@tgksolutions.com

• CTE: Temporary result set defined using WITH and reusable within the query. Improves readability for complex queries.
• Subquery: Nested query executed each time it is called. Example:
WITH SalesCTE AS (
SELECT employee_id, SUM(sales) AS total_sales
FROM sales
GROUP BY employee_id
)
SELECT * FROM SalesCTE WHERE total_sales > 5000;

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what is 'trigger' in sql? : Sql dba

1067


What are the packages in pl sql?

1000


what is collation? : Sql dba

1131


What are types of exception?

904


What is java sql package?

1073


What are all the common sql functions?

999


What is the use of stored procedures?

1024


What are the advantages of normalization?

1067


How can you maintain the integrity of your database on instances where deleting an element in a table result in the deletion of the element(s) within another table?

1117


What are the usages of sql?

1047


tell me about various levels of constraint. : Sql dba

1026


How do I find duplicates in sql?

916


Why is sql*loader direct path so fast?

1090


What are the disadvantages of file system?

1240


Why do we need cursor in pl sql?

1121