0

I created a table with the SQL:

CREATE TABLE `definition` ( name_sha256 CHAR(64) NOT NULL, id BIGINT UNSIGNED NOT NULL PRIMARY KEY, measure_name VARCHAR(256) NOT NULL ) 

and I want to check the upper bound of the field measure_name.

I explored around and only saw options to fetch the max value from existing rows by using

SELECT MAX((LENGTH(measure_name)) FROM definition 

which returns 50 based current values in the table but I expect to see the 256.

Would like to get help for retrieving the max bound

1
  • 1
    Tag your question with the database you are using. Commented Mar 5, 2021 at 0:55

1 Answer 1

2

If you want the official definition of the column, then you would use the metadata tables. Many databases use the standard SQL views for this purpose, which would look like:

select c.* from information_schema.columns c where c.table_name = 'definition' and c.column_name = 'measure_name'; 

You may also need to take the schema name into account as well.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.