# read last serial number in database

Posted by Asvreddy under C# on 12/12/2012 | Points: 10 | Views : 1342 | Status : [Member] | Replies : 9

EMP Table AS Follows;

EMPID EMPNAME MGRNo MGRNAME
1 Raj Null RAvi
2 Ram 1 Sam
3 ttt 2 ghg
4 Hari 3 Yogi

from the above EMP Table i wan the output as follows

total no of employes 4

#### Responses

Posted by: Naraayanan on: 12/12/2012 [Member] Starter | Points: 25
 0 Hi, ` Select max(EMPID ) from EMP ` Regards, Lakshmi Naraayanan.S http://dotnettechrocks.blogspot.in/ http://abaprocker.blogspot.com/Asvreddy, if this helps please login to Mark As Answer. | Alert Moderator
Posted by: Saratvaddilli on: 12/12/2012 [Member] [MVP] Bronze | Points: 25
 0 hi Please check this one `SELECT COUNT(EMPID ) FROM EMP ` which gives the count of total number of employees in the EMP table ` Select max(EMPID ) from EMP ` It will give only the max number of employee Id not the employees Thanks and Regards V.SaratChand Show difficulties that how difficult you areAsvreddy, if this helps please login to Mark As Answer. | Alert Moderator
Posted by: Pavanandey on: 12/13/2012 [Member] Bronze | Points: 25
 0 select count(Empid) from EMP gives you the number of employess count Thanks Pavan Kumar Mark Answer if this fits the needAsvreddy, if this helps please login to Mark As Answer. | Alert Moderator
Posted by: Ranjeet_8 on: 12/13/2012 [Member] [MVP] Gold | Points: 25
 0 check this `select count(EMPNAME) as TotalEmployee from EMP` Asvreddy, if this helps please login to Mark As Answer. | Alert Moderator
Posted by: Kundnani.Rt on: 1/19/2013 [Member] Starter | Points: 25
 0 In C#, you can do it with LINQ Extension Method: int n=.Count();Asvreddy, if this helps please login to Mark As Answer. | Alert Moderator
Posted by: Asvreddy on: 1/19/2013 [Member] Starter | Points: 25
 0 Hi, Check this code `select 'total no of employes' + convert(varchar(10),COUNT(EMPID )) from dbo.eSignupUsers ` Please Mark this answer, if it resolves your problem.Sourabh07Asvreddy, if this helps please login to Mark As Answer. | Alert Moderator