0
  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

This select query works fine, but I would like to create table from this query in SQL 2012, and I dont know how to do that.

Thanks in advance

0

1 Answer 1

1

If I understand you, you can use a INTO CLAUSE like so,

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
Sign up to request clarification or add additional context in comments.

1 Comment

Beat me to the punch by like 4 seconds

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.