Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

mysql select into new table

CREATE TABLE artists_and_works
  SELECT artist.name, COUNT(work.artist_id) AS number_of_works
  FROM artist LEFT JOIN work ON artist.id = work.artist_id
  GROUP BY artist.id;
Source by dev.mysql.com #
 
PREVIOUS NEXT
Tagged: #mysql #select #table
ADD COMMENT
Topic
Name
2+1 =