我正在使用 MySQL。
我正在尝试选择字段的最小、最大和平均长度,但我不确定如何。像这样的东西:
SELECT
min as min,
max as max,
avg as avg
FROM COLUMNS
WHERE COLUMN_NAME like '%password%'
有任何想法吗?
select
column_name,
min(length(column_name)) as min,
max(length(column_name)) as max,
avg(length(column_name)) as avg
from columns
where column_name like '%password%'
group by column_name
SELECT Min(COLUMN_NAME),
Max(COLUMN_NAME),
Avg(COLUMN_NAME)
FROM TABLENAME
WHERE COLUMN_NAME LIKE '%password%'
SELECT Min(MENTION_COLUMN_NAME_HERE) AS minimum_value,
Max(MENTION_COLUMN_NAME_HERE) AS maximum_value,
Avg(MENTION_COLUMN_NAME_HERE) AS average_value
FROM COLUMNS
WHERE COLUMN_NAME LIKE '%passord%'