I have a database table with many words and rows. (Now it has over 300 thousand records, but it is growing.) What would be the best way to get only those values that match the pattern? Let's say the table:
apples
oranges
abba
car
real
tipi
riot
tidy
Now, how to get only the CVCV template (ConsonantVowelConsonantVowel)? Or CVVC, LLLL (letter * 4), etc.? I could just create a column with different patterns:
word: real
patterns: LLLL,CVVC,LVVC,LVVL,LVLC,LLVC,LLLC,LVLL,CLLC,...
and search the database using "SELECT * FROM table WHERE word LIKE $ pattern", but I thought there is a better way?
source
share