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 |
How to execute the cursor queries with "open" statements?
You want to check the syntax of a complicated update sql statement without executing it. What command should you use?
What is WITH CHECK OPTION
3 Answers Karur Vysya Bank KVB,
what is web server?
How many types of subqueries are there in sql server?
What are the different types of Indexes available in SQL Server?
Define full outer join in sql server joins?
Explain what are sparse columns?
What are the different types of join?
What is a table called, if it has neither cluster nor non-cluster index? What is it used for?
How to add an address record into adventureworkslt?
What is the difference between temp table and table variable?
Oracle (3259)
SQL Server (4518)
MS Access (429)
MySQL (1402)
Postgre (483)
Sybase (267)
DB Architecture (141)
DB Administration (291)
DB Development (113)
SQL PLSQL (3330)
MongoDB (502)
IBM Informix (50)
Neo4j (82)
InfluxDB (0)
Apache CouchDB (44)
Firebird (5)
Database Management (1411)
Databases AllOther (288)