Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

nested query with all examples

SELECT
  artists.first_name,
  artists.last_name,
  artist_sales.sales
FROM artists
JOIN (
    SELECT artist_id, SUM(sales_price) AS sales
    FROM sales
    GROUP BY artist_id
  ) AS artist_sales
  ON artists.id = artist_sales.artist_id;
Source by learnsql.com #
 
PREVIOUS NEXT
Tagged: #nested #query #examples
ADD COMMENT
Topic
Name
2+6 =