Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to determine whether it exists in the mysql field

2025-04-11 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article is about how to determine whether the mysql field exists or not. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.

Methods: 1, using desc command, syntax is "desc table name field"; 2, using "show columns" command, syntax is "show columns from table name like field"; 3, using describe command, syntax is "describe table name field".

The operating environment of this tutorial: windows10 system, mysql8.0.22 version, Dell G3 computer.

How to determine whether it exists in the mysql field

1. Desc command

Format: desc tablename columnname

Example:

Desc `table``mid`desc `table`'% abc%'

2. Show columns command

Format: show columns from tablename like columnname

Example:

Show columns from `table`like 'mid'show columns from `table`like'% abc%'

3. Describe command

Format: describe tablename columnname

Describe is equivalent to show columns from

Example:

Describe `table`mid`table`% abc%' Thank you for your reading! This is the end of the article on "how to determine whether the mysql field exists". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it out for more people to see!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 241

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report