About 4,270,000 results
Open links in new tab
  1. How to get the mysql table columns data type? - Stack Overflow

    Aug 1, 2009 · Please use the below mysql query. SELECT COLUMN_NAME, DATA_TYPE, CHARACTER_MAXIMUM_LENGTH FROM information_schema.columns WHERE table_schema = '<DATABASE NAME>' AND table_name = '<TABLE NAME>' AND COLUMN_NAME = '<COLOMN NAME>'

  2. Select columns of specific type in MySQL 4.1 - Stack Overflow

    Dec 18, 2009 · select distinct table_name, column_name, column_type from information_schema.columns where table_schema = 'THE_DB_YOU_WANT_TO_QUERY' and column_type = 'smallint(5)'; Obviously, replace 'THE_DB_YOU_WANT_TO_QUERY' with the actual name of your database.

  3. 4 Ways to Check a Column’s Data Type in MySQL - Database.Guide

    Dec 14, 2021 · Here are four ways to get the data type of a column in MySQL. The SHOW COLUMNS Statement. The SHOW COLUMNS statement displays information about the columns in a given table or view. We can pass the name of the table or view to return information on its columns: SHOW COLUMNS FROM Pets; Result:

  4. How to Get the Type of Columns in SQL - GeeksforGeeks

    Apr 5, 2024 · In this article, we cover retrieving column types in SQL using three methods: SQL's Information Schema, the DESCRIBE statement, and Database GUI Tools. Each method offers insights into column types, aiding effective data management.

  5. sql - MySQL Query: Display Specific Column - Stack Overflow

    Jul 21, 2016 · SELECT store.name, store_type.name AS store_type FROM store LEFT JOIN store_type ON store.store_type_id = store_type.id If a store can have more than one type you would use an associative table to link the two instead …

  6. How to Get the Datatype of Table Columns in MySQL?

    Jun 25, 2024 · To check the data type of a column in MysQL we use the "INFORMATION_SCHEMA.COLUMNS" statement. Syntax: SELECT DATA_TYPE FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA = ‘database_name' AND TABLE_NAME = 'table_name';

  7. functions - How to find data type of output in MySQL?

    Mar 20, 2022 · You can use the column-type-info option to the mysql client. It reports the data types of the query results: % mysql --column-type-info Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 19 Server version: 8.0.26 MySQL Community Server - GPL ...

  8. 5.4 Getting Information About Databases and Tables - MySQL

    Field indicates the column name, Type is the data type for the column, NULL indicates whether the column can contain NULL values, Key indicates whether the column is indexed, and Default specifies the column's default value.

  9. MySQL :: MySQL 8.4 Reference Manual :: 5.3.4.3 Selecting …

    For example, to get birth dates for dogs and cats only, use this query: mysql> SELECT name, species, birth FROM pet WHERE species = 'dog' OR species = 'cat'; +-----+-----+-----+ | name | …

  10. How to check data type in mysql? - Database Administrators …

    Mar 20, 2024 · There is no built-in function to return the type of a variable or expression in MySQL. You can review the list of built-in functions here: https://dev.mysql.com/doc/refman/8.0/en/built-in-function-reference.html. The closest thing I can think of is to run the mysql command-line client with the --column-type-info option.

  11. Some results have been removed
Refresh