clear markdown compare help best fiddles feedback dbanow.uk a leap of faith?
clear markdown donate comments/suggestions/bugs a leap of faith? bible365 diddy dollings
By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0. 1716855 fiddles created (23943 in the last week).

create table messages(sent varchar(200), verif int); insert into messages values ('hello my name is alex', null), ('hey alin and alex I''m tom', null), ('hello alex my name is alin', null);
 hidden batch(es)


select * from messages;
sent verif
hello my name is alex
hey alin and alex I'm tom
hello alex my name is alin
 hidden batch(es)


with recursive cte as ( select substring(concat(sent, ' '), 1, locate(' ', sent)) word, substring(concat(sent, ' '), locate(' ', sent) + 1) sent from messages union all select substring(sent, 1, locate(' ', sent)) word, substring(sent, locate(' ', sent) + 1) sent from cte where locate(' ', sent) > 0 ) select row_number() over(order by count(*) desc, word) wid, word, count(*) freq from cte group by word order by wid
wid word freq
1 alex 3
2 alin 2
3 hello 2
4 is 2
5 my 2
6 name 2
7 and 1
8 hey 1
9 I'm 1
10 tom 1
 hidden batch(es)


select * from words;
Table 'db_2125433518.words' doesn't exist
 hidden batch(es)