我正在尝试将数据从 table1 转换为 table2
表格1
UserId Date1
1 9/26/2012
2 9/26/2012
1 9/26/2012
1 9/26/2012
2 9/26/2012
2 9/27/2012
2 9/27/2012
1 9/27/2012
表2
UserId Date1 recCount
1 9/26/2012 3
2 9/26/2012 2
1 9/27/2012 2
2 9/27/2012 1
这显然不起作用,但不知道从这里去哪里:
SELECT
UserId,
Date1,
Count(*)
FROM table1
GROUP BY UserId, Date1