ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
info       Did you received any Funny E-Mails from your Friends and like to share with rest of our friends? Yeah!! you can post that stuff   HERE
Google
 
Categories  >>  Software  >>  Databases  >>  SQL Server
 
 


 

 
 Oracle interview questions  Oracle Interview Questions
 SQL Server interview questions  SQL Server Interview Questions
 MS Access interview questions  MS Access Interview Questions
 MySQL interview questions  MySQL Interview Questions
 Postgre interview questions  Postgre Interview Questions
 Sybase interview questions  Sybase Interview Questions
 DB Architecture interview questions  DB Architecture Interview Questions
 DB Administration interview questions  DB Administration Interview Questions
 DB Development interview questions  DB Development Interview Questions
 SQL PLSQL interview questions  SQL PLSQL Interview Questions
 Databases AllOther interview questions  Databases AllOther Interview Questions
Question
How to get the count of distinct records. Please give me the
query?
 Question Submitted By :: Srikanth
I also faced this Question!!     Rank Answer Posted By  
 
  Re: How to get the count of distinct records. Please give me the query?
Answer
# 1
SELECT     COUNT(*)FROM(SELECT DISTINCT columnname FROM 
tblname)
 
Is This Answer Correct ?    3 Yes 3 No
Anusha
 
  Re: How to get the count of distinct records. Please give me the query?
Answer
# 2
SELECT count(*) FROM 
(SELECT distinct  ngcode FROM donation )d
 
Is This Answer Correct ?    2 Yes 4 No
Gouri
 
 
 
  Re: How to get the count of distinct records. Please give me the query?
Answer
# 3
this will also work

select count(distinct columnname) from table
 
Is This Answer Correct ?    8 Yes 1 No
Kanika
 
  Re: How to get the count of distinct records. Please give me the query?
Answer
# 4
select count(distinct columnname) from table ,this is correct as i checked the query
 
Is This Answer Correct ?    7 Yes 1 No
Name
 
  Re: How to get the count of distinct records. Please give me the query?
Answer
# 5
select count(*) from (select distinct * from tablename)as
dummytable
 
Is This Answer Correct ?    1 Yes 1 No
Madhavi.bandreddi
 

 
 
 
Other SQL Server Interview Questions
 
  Question Asked @ Answers
 
one table has four field id,name,design,salary. i have to find maximum salary .  6
What is the basic functions for master, msdb, tempdb databases? CSC2
How to find the date and time of last updated table?  3
can you any body tell me the how to decrease the logfile  4
What is the difference between Userdefined function and stored procedure? Explain and give the example also  4
what is the output for this query select * from employee where 1=1;  4
About DTS usage ? Cognizent2
What value could be assigned to Varchar Type?  3
Can we rewrite subqueries into simple select statements or with joins? Example? ASD1
Which is the subset of SQL commands used to manipulate Oracle Database structures, including tables?  2
How to select nth record from a table? DELL9
When do you create cluster and noncluster index? Satyam4
Can Having clause be used without Group by clause? CTS4
please can anyone answer this query Table 1 has 2 columns: EmployeeId,Age Table 2 has 2 columns: EmployeeId, Region Write SQL to Find the region who has the oldest person  7
How to give a user the option of importing Excel and a delimited text file into a SQL Server Database without manually using SQL DTS? GE1
What is referential integrity? What are the advantages of it? Digital-Domain3
how to find out the repeated value from table using groupby function?  3
Can store procedure call by user define function in SQL server? HCL6
In which year relase the 7.0& 2000 & 2005?  1
How can I create a plain-text flat file from SQL Server as input to another application?  2
 
For more SQL Server Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com