Select
Books.IdBooks,
Books.Title,
Books.Author,
COUNT(Books.IdBooks) as NumberOfOrderedBooks
From Books
right join Orders
on (Books.IdBooks = Orders.IdBooks)
group by
Books.IdSeminar,
Books.Naziv
这个选择查询工作正常,但我想在SQL 2012中从这个查询创建表,我不知道该怎么做。
提前致谢
答案 0 :(得分:1)
如果我了解你,你可以使用INTO CLAUSE之类的,
Select
Books.IdBooks,
Books.Title,
Books.Author,
COUNT(Books.IdBooks) as NumberOfOrderedBooks
Into NEW_TABLE
From Books
right join Orders
on (Books.IdBooks = Orders.IdBooks)
group by
Books.IdSeminar,
Books.Naziv