0

I have the database below its table name is marked,

img

please help me a code to create another table below

Img1

SELECT [ID] , sum([physics])
FROM [mark]
GROUP BY [ID]
Mohamed
  • 1
  • 6

1 Answers1

0

Just add two more fields:

SELECT [ID] , sum([physics]), sum([math]), sum([sum]) 
FROM [mark]
GROUP BY [ID]

If you want to create a table use following script:

CREATE TABLE new_table AS
SELECT [ID] , sum([physics]), sum([math]), sum([sum]) 
FROM [mark]
GROUP BY [ID]
i.bondarenko
  • 3,442
  • 3
  • 11
  • 21