|
|
how to get year from date field? - Mysql
|
Views : 957
|
|
Tagged in : Mysql
|
|
|
Report This Scrap as Inappropriate We request you to choose the appropriate categroy and subcategory that suits your
objectionable concern about the scrap, So that our team can review and find out whether it violates our Guidelines or the
scrap is not suitable for all viewers.
|
Get year from date field:
Sometimes we need to get only year from the date("2006-12-05").
In that case use YEAR( ) as,
mysql> SELECT YEAR(datefield) FROM tablename;
For example,
mysql> SELECT * from table_name where year(datefield)='2006'; |
|
By Ramya, On - 2008-12-09 |
|
|
|