Как найти самые длинные слова в столбце SQL? Например, слова длиной более 10 символов?
Заголовки столбца TITLE курсивом имеют не более 10 символов;
Вы можете использовать:
select length(t.col) as l_col, t.col
from
(
select 'Non-homogeneous Carbon Fiberconcrete' as col
union all
select 'Accidental Shot'
union all
select 'Overtraining in Swimming'
union all
select 'Requirements in Agile Chemical From Syngas'
) t
order by l_col desc
limit 1;
L_COL COL
----- ------------------------------------------
42 Requirements in Agile Chemical From Syngas
where length(t.col) >= 10
бесполезна?
Вот мой код для SQL Server.
select c.name as col
from sys.columns c
join sys.tables t ON c.object_id = t.object_id
where t.name = 'your table name'
and len(c.name) > 10