How to extract a unit value from a date and time?



How to extract a unit value from a date and time?..

Answer / Asit Kumar

To extract a specific unit (e.g., year, month, day) from a date and time in MySQL, use the `EXTRACT` function:nnFor example: nn* `SELECT EXTRACT(YEAR FROM your_date_time_column);` for getting the year

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More MySQL Interview Questions

Is mysql deprecated?

1 Answers  


What is user in mysql?

1 Answers  


What are the different table present in MYsql?

3 Answers  


Is there a free version of mysql?

1 Answers  


How do I run mysql on a mac?

1 Answers  


What is mysql slow query?

1 Answers  


What is maximum table size in mysql?

1 Answers  


How can we store binary data in mysql?

2 Answers   HP,


How do I insert multiple rows in a table?

1 Answers  


How to delete a trigger in mysql?

1 Answers  


Is primary key auto increment?

1 Answers  


How to check server status with 'mysqladmin'?

1 Answers  


Categories