Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Let's suppose your table has columns called <code>Title</code>, <code>path</code> and <code>request_date</code>, then, your query could be:</p> <pre><code> select Title, path, (select count(*) from page_views as pv2 where month(request_date)=2 and pv1.Title = pv.Title and pv2.path = pv.path ) as January, (select count(*) from page_views as pv1 where month(request_date)=2 and pv1.Title = pv.Title and pv2.path = pv.path ) as February, (select count(*) from page_views as pv3 where month(request_date)=3 and pv1.Title = pv.Title and pv2.path = pv.path ) as April, (select count(*) from page_views as pv5 where month(request_date)=5 and pv1.Title = pv.Title and pv2.path = pv.path ) as May, (select count(*) from page_views as pv6 where month(request_date)=6 and pv1.Title = pv.Title and pv2.path = pv.path ) as June, (select count(*) from page_views as pv7 where month(request_date)=7 and pv1.Title = pv.Title and pv2.path = pv.path ) as July, (select count(*) from page_views as pv1 where month(request_date)=1 and pv1.Title = pv.Title and pv2.path = pv.path ) as January, (select count(*) from page_views as pv8 where month(request_date)=8 and pv1.Title = pv.Title and pv2.path = pv.path ) as August, (select count(*) from page_views as pv9 where month(request_date)=9 and pv1.Title = pv.Title and pv2.path = pv.path ) as September, (select count(*) from page_views as pv10 where month(request_date)=10 and pv1.Title = pv.Title and pv2.path = pv.path ) as October, (select count(*) from page_views as pv11 where month(request_date)=11 and pv1.Title = pv.Title and pv2.path = pv.path ) as November, (select count(*) from page_views as pv12 where month(request_date)=12 and pv1.Title = pv.Title and pv2.path = pv.path ) as December from (select distinct Title,path from page_views ) as pv </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload