sqlite - giving a select of strings that only contain strings from another table -
I have to write the correct SQLite query to get the following difficulties.
I have 2 tables: words and sounds
example: content table word:
** word name ** app base house step round hat hoot Hot
Content table sounds:
** SoundNote ** ** SonicActive ** 1BO O1UUUUU1S1H1T 1 EFP1
I would like to write a question that gives me the word back in which only active sounds are notices ou
o
with u
. Therefore the result should be in this case: hat
I came up with:
words Choose the word from the word. '%' Like Word_name || Sounds. Normal name || '%' Where sounds.soundActive = 1 group by words.wordName;
But it also gives me words that the voices are not active. As soon as it has an active sound, the word is given.
I tried 'code' words.wordName not like '%' || Sounds || Sound || '%' Where sounds sounds.sctive = 0
UPDATE: Yohanes Khosiawan works on the second solution sqlite. Join the word as a word with the word '.' Sound.swordName like name || The '%' group with the word 'word' WordName having allactct = 1;
But to get the sounds along with one / two letters, I will create a new table: Example: Content table sound 2:
** Sound2Name * * ** sound2Active ** au 0 ou1o 0
results My SQL was looking like this: SQLfiddle: home
, hat
, hot <' To solve the problem with O, both 'OU' correspond to 'O'. And 'U', I will replace 'OU' with a special character in a sound table. I used '$' then you can replace 'ou' with '$' in your words before 'joining'.
Choose words from words to join where '(' word '.' 'Name', 'ou', '$' ) Looks like '%' || Voice group || Words by '%' group WordName (minimum active) = '1'
Comments
Post a Comment