SQL rollup two columns error

38 views Asked by At

i am having error in SQL saying:

Msg 213, Level 16, State 1, Line 7
Column name or number of supplied values does not match table definition.

Code:

CREATE TABLE temp
(
kolA varchar(255),
kolB varchar(255)
);

INSERT temp VALUES
('A','B'),
('B','B'),
('B','B'),
('A','B'),
(null,'B'),
('B','B');

select kolA,kolB,ilośc = COUNT(*) from temp
GROUP BY rollup(kolA,kolB);

DROP TABLE temp

i do not know why this error occurs, can someone tell me?

1

There are 1 answers

1
Karl Kieninger On BEST ANSWER

This works fine against 2008 in a fiddle.

http://sqlfiddle.com/#!3/61dc9d/1