下面count的返回值是多少?
CREATE TABLE mytable ( myid INT, mychar VARCHAR(10) );GOINSERT mytable ( myid, mychar ) VALUES ( 1, 'A' ), ( 2 , 'B'), ( NULL, 'C' ), ( 4, 'D' ), ( NULL, 'E' ), ( 6, 'F' );--Query1SELECT COUNT(MyID) FROM mytable;--Query2SELECT COUNT( DISTINCT MyID) FROM mytable; --Query3 SELECT COUNT(DISTINCT *) FROM mytable;
答案
--Query1:4--Query2:4--Query3:ERROR