Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have written a query to fetch a time internal:

select *, (Time + interval '2012-12-18 13:36:47' minute)  from chatnotiservice;

Is it possible to name the (Time + interval '2012-12-18 13:36:47' minute) column?

share|improve this question
up vote 6 down vote accepted

Use AS. For example:

mysql> select 'data' as mycolumnname;
| mycolumnname |
| data         |
1 row in set (0.00 sec)


If you actually want to name the column after the date operation you're performing (your question isn't clear), you can do it by enclosing it in backticks. For example:

mysql> select 'data' as `Time + interval '2012-12-18 13:36:47' minute` ;
| Time + interval '2012-12-18 13:36:47' minute |
| data                                         |
1 row in set (0.00 sec)


I suspect what you mean is the following:

select *,(Time + interval '2012-12-18 13:36:47' minute) AS mytime from chatnotiservice;
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.