标签: sql sql-server sql-server-2008 tsql database-cursor
我正在使用光标,并想知道这是否可以废除和优化?
答案 0 :(得分:0)
SELECT s.StudentId, COUNT(*) AS CreationCount FROM Student s INNER JOIN CreationHist c ON c.StudentId = s.StudentId WHERE c.CreateDate = '05/02/2011' GROUP BY s.StudentId