Home > Database > Mysql Tutorial > body text

How to find all columns with column name length greater than 5 in MySQL?

PHPz
Release: 2023-09-22 19:57:09
forward
854 people have browsed it

How to find all columns with column name length greater than 5 in MySQL?

Use HAVING to find all columns whose column names are longer than 5. This will produce the following output -

+-------------------+-------------------------+
| TABLE_NAME        | COLUMN_NAME             |
+-------------------+-------------------------+
| DemoTable         | UserId                  |
| DemoTable         | EndDate                 |
| DemoTable         | StartDate               |
| DemoTable         | StudentFavouriteSubject |
| DemoTable         | StudentFirstName        |
| DemoTable         | StudentId               |
| DemoTable         | ShippingDate            |
| DemoTable         | Number                  |
| DemoTable         | Value1                  |
| DemoTable         | Value2                  |
| DemoTable         | ArrivalDate             |
| DemoTable         | ShippingDate            |
| DemoTable         | UserAge                 |
| DemoTable         | UserId                  |
| DemoTable         | UserName                |
| DemoTable         | CustomerId              |
| DemoTable         | CustomerValue           |
| DemoTable         | UserId                  |
| DemoTable         | UserMailId              |
| DemoTable         | FirstName               |
| DemoTable         | Number                  |
| DemoTable         | isMarried               |
| DemoTable         | Number                  |
| DemoTable         | FruitName               |
| DemoTable         | FruitPrice              |
| DemoTable         | CustomerAllProductPrice |
| DemoTable         | CustomerId              |
| DemoTable         | CustomerName            |
| DemoTable         | UserId                  |
| DemoTable         | UserScore               |
| DemoTable         | StudentAge              |
| DemoTable         | StudentCountryName      |
| DemoTable         | StudentFirstName        |
| DemoTable         | StudentId               |
| DemoTable         | StudentLastName         |
| DemoTable         | FirstName               |
| DemoTable         | Arrivaldatetime         |
| DemoTable         | Amount                  |
| DemoTable         | Number                  |
| DemoTable         | Number                  |
| DemoTable         | FirstName               |
| DemoTable         | CustomerId              |
| DemoTable         | CustomerPrice           |
| DemoTable         | CustomerProductName     |
| DemoTable         | CustomerProductQuantity |
| DemoTable         | Value1                  |
| DemoTable         | Value2                  |
| DemoTable         | FirstName               |
| DemoTable         | LastName                |
| DemoTable         | UserId                  |
| DemoTable         | MonthNumber             |
| DemoTable         | YearNumber              |
| insertcurrentdate | currentDate             |
| student           | first_name              |
| student           | last_name               |
+-------------------+-------------------------+
55 rows in set (0.01 sec)
Copy after login

The above is the detailed content of How to find all columns with column name length greater than 5 in MySQL?. For more information, please follow other related articles on the PHP Chinese website!

source:tutorialspoint.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!