In select-mysql, how does one query all fields and convert one of the fields?

Source: Internet
Author: User
In mysql, how to query all fields and convert one of the fields? for example, select * fromtablewhereid1. in table, a date field needs to be converted to stringDATE_FORMAT (updateTime, & #39; % Y-% m-% d % H: % I: % s & #39;) asupdateTime indicates that each field is not typed, is there any other way to process the date ???, If the field is too much trouble, the SQL statement will still have a long selectupdatetime field javamysql

In mysql, how can I query all fields and convert one of them?

For example, select * from table where id = 1;
In the table, there is a date field that needs to be converted to string during output.
DATE_FORMAT (updateTime, '% Y-% m-% d % H: % I: % S') as updateTime
This means that you do not need to input every field and then use the date processing method.
Is there any other way ???, If the field is too complicated, the SQL statement will be too long.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.