I have a problem with extracting data from one table.
I have a table, t_stat, as follows:
id, country, instId, date
1, Belgium, 1, 2014-04-06
2, Germany, 2, 2013-05-07
3, Italy, 3, 2018-06-08
What I need as a result: i need to pick up every distinct country, and count how much installs it has on each date. It should look like this:
Date Belgium Germany Italy
2013-05-07 0 1 0
2014-04-06 1 0 0
2018-06-08 0 0 1
I know, result can be achieved with pivot, but I can not construct query.
Thanks in advance.