About 180,000 results
Open links in new tab
  1. SQL | Subquery - GeeksforGeeks

    Apr 14, 2025 · What is SQL Subquery? In SQL, a subquery can be defined as a query embedded within another query. It is often used in the WHERE, HAVING, or FROM clauses of a statement. Subqueries are commonly used with SELECT, UPDATE, INSERT, and DELETE statements to achieve complex filtering and data manipulation. They are an essential tool when we need to ...

  2. SQL Subqueries: What They Are and When to Use Them

    Mar 25, 2023 · One of the most useful features of SQL is subqueries, which allow you to use the result of one query as the input for another query. In this article, we’ll explain what subqueries are, how they work, and when to use them.

  3. When to use SQL sub-queries versus a standard join?

    Jan 25, 2011 · Subqueries are usually fine unless they are dependent subqueries (also known as correlated subqueries). If you are only using independent subqueries and they are using appropriate indexes then they should run quickly.

  4. SQL Subquery - SQL Tutorial

    Summary: In this tutorial, you’ll learn how to use SQL subqueries to form flexible queries for retrieving data from the database. A subquery is an SQL query nested inside another query. The query that contains a subquery is known as an outer query. To write a subquery, you need to have a deep understanding of the SELECT statement: select_list.

  5. How to Use the SQL Subquery: A Detailed Guide | Codecademy

    Mar 25, 2025 · In this query: The subquery is executed first. It searches the departments table and returns the department_id of the ‘Sales’ department.; Next, the outer query is executed. It retrieves the department_id returned by the subquery and returns all employees whose department_id matches with the retrieved one.; This is how queries, including subqueries, are executed in SQL.

  6. How to Use a Subquery in a SELECT Statement - GeeksforGeeks

    Jan 2, 2025 · In the context of a SELECT statement, subqueries allow retrieving values or conditions dynamically by enabling complex and flexible data extraction. In this article, We will learn about Subquery in a SELECT statement by understanding various examples and output in …

  7. SQL Subqueries - w3resource

    Feb 13, 2025 · A subquery is a SQL query nested inside a larger query. The subquery can be nested inside a SELECT, INSERT, UPDATE, or DELETE statement or inside another subquery. A subquery is usually added within the WHERE Clause of another SQL SELECT statement. You can use the comparison operators, such as >, <, or =.

  8. SQL Server SUBQUERY with Examples - SQL Server Tutorial

    What is SUBQUERY in SQL Server? A SUBQUERY is a SQL query within a SQL statement. A subquery can be part of a SELECT, INSERT, UPDATE or DELETE statement and is itself always a SELECT query. It is also possible for a subquery to have another subquery within it.

  9. SQL Subquery: A Comprehensive Guide - DataCamp

    Jan 16, 2025 · SQL subqueries are a powerful tool in database management, allowing for more complex and efficient data retrieval. This guide will walk you through the fundamentals of SQL subqueries, offering insights into their practical applications and advanced techniques.

  10. SQL Subquery: Syntax, Usage, and Examples - mimo.org

    You can use a subquery to filter results dynamically, compute derived values, or create virtual tables within your main query. Subqueries can appear in different parts of a SQL statement. They are commonly found in the SELECT, FROM, WHERE, and HAVING clauses, depending on the use case. FROM table1.

  11. Some results have been removed
Refresh