How to obtain the names and values of all fields in a piece of data in mysql-Mysql

Source: Internet
Author: User
There is a table User with the Field id, name, password, and mobile. now, you need to obtain the names of all fields in id1 in the User table and save them as & #39; key & #39;. the corresponding value is & #39; value & #39; for example, there is a record in the table: idnamepasswordmobile1test123138100138000. now you need to obtain this record and save it as keyvalueid1nametestpassword123mobile13800138000 mysql

There is a table User with the Field id, name, password, and mobile.
Now, the names of all fields with id = 1 in the User table are saved as 'key', and the corresponding value is 'value'

For example, there is a record in the table:
Id name password mobile
1 test 123 138100138000

Now you need to obtain this record and save it

Key value
Id 1
Name test
Password 123
China mobile 13800138000

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.