Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • SQL Select Coun statement

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 208
    Comment on it

    Count ( ) In SQL Database this is a function which return no of rows from a table in Database . Generally this is used in SQL select statement and count the no. of records in a table .
    Syntax ->

    select count ( expression_name ) from table_name where clause ;
    

    Example ->
    Suppose i have a table , name is student

    **Student_name**    **Student_Age**    **Student_Id**
       Mukesh               23                 1
       Ayush                24                 2
    

    Suppose i want to count number of records in a table then we can do with the count ( ) function .

    select count ( * ) from student ; // Output -> 2
    

    To count distinct column_name

    select count ( distinct Student_Age )  from student ; // Output -> 1
    

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: