SQL function with example
Date : It is used to get date.Date function In Mysql :
CURDATE() : To get date only
Now() : To get date with time
Example :
Query :
Select Now()
Result :
| Now() |
|---|
| 2016-03-25 23:28:11 |
Date function In SQL
GETDATE()Example :
Query :
Select GETDATE()
Result :
| No Column |
|---|
| 2016-03-25 23:28:11 |
Count function In SQL
Count function is used to count the number of rows in a table.
COUNT()
Example :
Consider the below table : Salary:
| Emp_id | Emp_salary | Emp_name |
|---|---|---|
| 01 | 25000 | Chandan |
| 02 | 30000 | Adhiraj |
| 03 | 25000 | Akshat |
Query :
Select COUNT(Emp_id)
from Salary
Result :
| Emp_id |
|---|
| 3 |
No comments:
Post a Comment