我在Java中使用此代码,我需要将结果插入到新表中。只需编辑此查询就可以了吗?
ResultSet result = stat.executeQuery("SELECT artist, COUNT(artist) AS countartist FROM table1 GROUP BY artist ORDER BY countartist DESC;");
答案 0 :(得分:-1)
试试这个:
ResultSet result = stat.executeUpdate(" CREATE TABLE newtable AS SELECT artist,COUNT(artist)AS countartist FROM table1 GROUP BY artist ORDER BY countartist DESC");