JavaScript required
We’re sorry, but Coda doesn’t work properly without JavaScript enabled.
Skip to content
Gallery
Handbok Databaskommunikation
Huvudmoment
Databas
Google Cloud
Big Query
API
Protokoll
Säkerhet
MySQL Workbench
More
Share
Explore
SQL
Nested Queries
Exempel-Querys
A nested SELECT is a query within a query
, i.e. when you have a SELECT statement within the main SELECT.
Basera queryn på resultatet från en annan query
SELECT
*
FROM
students
WHERE
GPA > (
SELECT
AVG(GPA)
FROM
students);
SELECT
AVG(number_of_students)
FROM
classes
WHERE
teacher_id IN
(
SELECT
id
FROM
teachers
WHERE
subject = 'English'
OR
subject = 'History');
Want to print your doc?
This is not the way.
Try clicking the ⋯ next to your doc name or using a keyboard shortcut (
Ctrl
P
) instead.