There are more than 200 thousand lines in the table (test and its copy test1). In the 'title' column, non-unique str. It is necessary to create a query that produces a table with grouped rows in the column 'title' where there is an entry of the contents of the 'title' of each row. Those.:

SELECT test1.title, count(test1.title) as count FROM test JOIN #ΠΈΠ· ΠΊΠΎΠΏΠΈΠΈ Ρ‚Π°Π±Π»ΠΈΡ†Ρ‹ Π²Ρ‹Π±ΠΈΡ€Π°Π΅ΠΌ ΠΊΠ°ΠΆΠ΄ΡƒΡŽ строку ΠΈ ΠΈΡ‰Π΅ΠΌ строки Π² ΠΊΠΎΡ‚ΠΎΡ€Ρ‹Ρ… Π΅ΡΡ‚ΡŒ #совпадСния с искомым Π·Π½Π°Ρ‡Π΅Π½ΠΈΠ΅ΠΌ test1 ON test.title LIKE CONCAT('%',test1.title,'%') #Π³Ρ€ΡƒΠΏΠΏΠΈΡ€ΡƒΠ΅ΠΌ Ρ€Π΅Π·ΡƒΠ»ΡŒΡ‚Π°Ρ‚Ρ‹, ΠΈΠ΄Π΅Ρ‚ подсчСт совпадСний GROUP BY test1.title ORDER BY count DESC; 

The request is launched, but not executed - it completes automatically for 600 seconds.

  • Can try through full-text search? - Vasily Butorin
  • Well, as if yes, it is worth trying full-text, not forgetting to build a fulltext index for it - Mike
  • But as? ) SELECT * FROM test WHERE MATCH (title) AGAINST ('*test.title*' IN BOOLEAN MODE); - Vasily Butorin

0