I have a table: name, date, url, no, url includes "facebook","twitter","other".
How can I generate a new table: date, facebook, twitter, total, unique name, such that, grouping by date, facebook field is the sum of the no WHERE url="facebook", and same as twitter; total field is the sum of the no of all; unique name counts the distinct name number?
You can use SUM/CASE for this.