How to create table based on JDBC Result Set

后端 未结 5 1887
春和景丽
春和景丽 2020-12-18 15:24

I am building a reporting tool and I need to execute queries on remote databases and store the result set in my own database (because I do not have write permission on remot

5条回答
  •  春和景丽
    2020-12-18 16:27

    As sepcified here you can do it in plain SQL like so:

    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;
    

提交回复
热议问题