What is the datatype returned by count(*)
Answers were Sorted based on User's Feedback
Answer / harsh
SELECT COUNT(*) as "Number of employees"
FROM employees
WHERE salary > 55000;
It would return the following result set:
Number of employees
5
HENCE IT RETURNS 'INT' TYPE.
Is This Answer Correct ? | 3 Yes | 0 No |
Answer / sanjeev kumar
It will return Int or Bigint depend on the size of the row.
(But both are same)
Is This Answer Correct ? | 2 Yes | 0 No |
Answer / thirumal
count(*) returns the total number of not null values in
given column
Is This Answer Correct ? | 3 Yes | 3 No |
Answer / lakshmi narayanan r
It will return INT. Proof is here...
SELECT COUNT(*) AS Total INTO tmpArchiveStoreMaster1 FROM
ArchiveStoreMaster asm
GO
sp_help tmpArchiveStoreMaster1
Name
Owner
Type
Created_datetime
--------------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------------
------------------------------- -----------------------
tmpArchiveStoreMaster1
dbo
user table 2010-07-06
15:43:05.310
Column_name
Type
Computed Length
Prec Scale Nullable
TrimTrailingBlanks FixedLenNullInSource
Collation
--------------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------------
----------------------------------- ----------- ----- -----
-----------------------------------
-----------------------------------
-----------------------------------
--------------------------------------------------------------------------------------------------------------------------------
Total
int
no 4
10 0 yes (n/a)
(n/a)
NULL
Is This Answer Correct ? | 0 Yes | 0 No |
Answer / haribabu
it returns how meny columns in the data table (or)
how meny records in the table
Is This Answer Correct ? | 1 Yes | 4 No |
Answer / server.getlasterror().message
Server.GetLastError().Message
Is This Answer Correct ? | 2 Yes | 5 No |
What is the difference between constraints and triggers?
explain different types of jions with examples briefly?
What's the difference between a primary key and a unique key?
How to Check if table exists in sql server?
optimization techinques
1. What is CUBE Operator? 2. what are the new data types are available in sql server 2008? 3. Inisde a nested queries, how many subqueries u can have?
Write a program to fetch first 10 records from a file?
What are the triggers in sql?
Explain the various types of concurrency problem. I.e. Lost or buried updates, uncommitted dependency, inconsistent analysis, phantom read?
How to view the error log for any specific instance? : sql server database administration
What happens when converting big values to numeric data types?
What is the difference between DATETIME2 and DATETIME?