Tabele pochodne

SQL Server średnio zaawansowany

Ginger Grant

Instructor

Czym są tabele pochodne?

  • Zapytanie traktowane jak tabela tymczasowa
  • Zawsze zawarte w zapytaniu głównym
  • Określane w klauzuli FROM
  • Mogą zawierać obliczenia pośrednie lub inne złączenia niż w zapytaniu głównym
SQL Server średnio zaawansowany

Tabele pochodne w T-SQL

SELECT a.* FROM Kidney a
-- This derived table computes the Average age joined to the actual table 
JOIN (SELECT AVG(Age) AS AverageAge 
      FROM Kidney) b 
ON a.Age = b.AverageAge
SQL Server średnio zaawansowany

Czas na ćwiczenia!

SQL Server średnio zaawansowany

Preparing Video For Download...