Heim >Datenbank >MySQL-Tutorial >Wie finde ich in MySQL alle Spalten mit einer Spaltennamenlänge von mehr als 5?
Verwenden Sie HAVING, um alle Spalten zu finden, deren Spaltennamen länger als 5 sind. Dadurch wird die folgende Ausgabe erzeugt:
+-------------------+-------------------------+ | 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)
Das obige ist der detaillierte Inhalt vonWie finde ich in MySQL alle Spalten mit einer Spaltennamenlänge von mehr als 5?. Für weitere Informationen folgen Sie bitte anderen verwandten Artikeln auf der PHP chinesischen Website!