Advertisement
bagaspramudita

Kueri Tarik Data Semua Artikel

Apr 10th, 2018
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MySQL 1.04 KB | None | 0 0
  1. SELECT
  2.     g.gid as gid,
  3.     c.title as title,
  4.     c.category as category,
  5.     c.url_source as url_source,
  6.     c.url as url,
  7.     c.language as language,
  8.     c.author as author,
  9.     c.display_regions as regions,
  10.     c.video_duration as video_duration,
  11.     c.mp_id as media_platform,
  12.     SUM(g.all_click_count) AS click,
  13.     SUM(g.all_impression_count) AS impression,
  14.     SUM(g.all_click_count) / SUM(g.all_impression_count) * 100 AS ctr,
  15.     SUM(g.share_count) AS share,
  16.     SUM(g.digg_count) AS digg,
  17.     SUM(g.bury_count) AS bury,
  18.     SUM(g.favorite_count) AS favorite
  19. FROM
  20.     `i18n_pgc_dw_sg`.log_v3_item_stats g
  21.     LEFT JOIN `default`.crawl_group_stats_all c ON g.gid = c.gid
  22. WHERE
  23.     (
  24.         g.`date` BETWEEN '20180301'
  25.         AND '20180331'
  26.     )
  27.     AND g.app_id IN (1245, 1124, 1125, 1194)
  28.     AND c.language = 'id'
  29.     AND c.composition in (72, 256, 264, 384)
  30. GROUP BY g.gid, c.title, c.category, c.url_source, c.url, c.language, c.author, c.display_regions, c.video_duration, c.mp_id
  31. ORDER BY click DESC
  32. LIMIT 5000
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement