3
我有一個表命名tb_tweetkurator_test
和查詢是:查詢插入從選擇查詢
SELECT id_user,
COUNT(id_tweet) as JML_TWEET,
COUNT(IF(url = 'yes', url, NULL)) as JML_TWEET_URL,
COUNT(IF(mention = 'yes', mention, NULL)) as JML_TWEET_MENTION,
COUNT(IF(retweet = 'yes', retweet, NULL)) as JML_TWEET_RETWEET,
COUNT(IF(tweet_biasa = 'yes', tweet_biasa, NULL)) as JML_TWEET_BIASA
FROM tb_tweetkurator_test
GROUP BY id_user;
,其結果是
id_user | JML_TWEET | JML_TWEET_URL| JML_TWEET_MENTION | JML_TWEET_RETWEET | ML_TWEET_BIASA
16912985 | 20 | 6 | 13 | 0 | 3
23343960 | 10 | 10 | 0 | 0 | 0
46651600 | 20 | 9 | 17 |15 | 2
267164011 | 20 | 14 |10 |4
是什麼讓我搞不清是,我可以插入上述數據(從SELECT
查詢)到一個新表?
您正在使用哪些DBMS? –