SQLite, select where field 'like' field from another table

amateurjustin

I'm trying to remove "bad words" from a table using a list of offensive words from another table, but the offensive words are often in lemma form. Thus, I can't always do a exact match. I need to use a LIKE quantifier, for example WHERE text LIKE '%badword%'

Is there a way for me to try to select all the rows that contains a word from another table, but by specifically using the LIKE clause.

I'll give an example of what I was trying to do. This didn't work, but should give you an idea of what I'm trying to do:

SELECT *
FROM entry 
WHERE headword LIKE IN
( SELECT word
FROM sies )

Now I know that the LIKE doesn't fit into this query, but I'm trying to get something to this effect working.

EDIT: This is the latest thing I tried, that did not work:

SELECT s.*
FROM sies AS s, entry AS e 
WHERE e.headword LIKE ('%' + s.word + '%')
Prerak Sola

You can try the following query:

select s.* from sies s, entry e where s.words like '%' || e.word || '%'

Here I have assumed that, sies is your regular table and entry is the table with the dirty words.

You can check the Demo here.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

select multiple columns from another table where field contains array

From Dev

select field from table in another field from another table

From Dev

SQLite select and count from another table with like

From Dev

SQLite select average from one table and update average field from another table using trigger

From Dev

Select from Table Where field equals a variable

From Dev

Select from mysql table WHERE field in '$array'?

From Dev

Select Additional Field from another Table

From Dev

Call field from another table in select firebase

From Dev

Select all fields from a table where a field in another table with an ID is equal to a string

From Dev

SELECT * FROM table WHERE "substring" IN table_field?

From Dev

Select field from table A where subselect from table B = table A field

From Dev

BigQuery: select from regexp_match where field in other table

From Dev

Dynamic table name in where clause using a field from select

From Dev

Select all columns from table where one field is duplicated

From Dev

Laravel select random rows from table based on another field

From Dev

why if($row['field'] == value) work like SELECT WHERE field = value?

From Dev

select (sum(field) - max(field)) from table group by field

From Dev

SELECT where when Max of one field corresponding field in another is something

From Dev

select values of one field where another field equals a value in rails

From Dev

Select (Select field from FieldTable) from Table

From Dev

MYSQL - Select all rows in a table where it's ids in another table as string field

From Dev

MySQL - How to select rows in a table where id value is in a comma delimited field in another table?

From Dev

select a field values that are not found in another table

From Dev

select a field values that are not found in another table

From Dev

SQL, select field if field doesn't exist in another table

From Dev

SQL, select field if field doesn't exist in another table

From Dev

How to create new field in view with some offset (field of table) from existing field (another field of table)?

From Dev

Fastest way to count from a table where a certain field exists in another table?

From Dev

Select from JSONB field with WHERE clause

Related Related

  1. 1

    select multiple columns from another table where field contains array

  2. 2

    select field from table in another field from another table

  3. 3

    SQLite select and count from another table with like

  4. 4

    SQLite select average from one table and update average field from another table using trigger

  5. 5

    Select from Table Where field equals a variable

  6. 6

    Select from mysql table WHERE field in '$array'?

  7. 7

    Select Additional Field from another Table

  8. 8

    Call field from another table in select firebase

  9. 9

    Select all fields from a table where a field in another table with an ID is equal to a string

  10. 10

    SELECT * FROM table WHERE "substring" IN table_field?

  11. 11

    Select field from table A where subselect from table B = table A field

  12. 12

    BigQuery: select from regexp_match where field in other table

  13. 13

    Dynamic table name in where clause using a field from select

  14. 14

    Select all columns from table where one field is duplicated

  15. 15

    Laravel select random rows from table based on another field

  16. 16

    why if($row['field'] == value) work like SELECT WHERE field = value?

  17. 17

    select (sum(field) - max(field)) from table group by field

  18. 18

    SELECT where when Max of one field corresponding field in another is something

  19. 19

    select values of one field where another field equals a value in rails

  20. 20

    Select (Select field from FieldTable) from Table

  21. 21

    MYSQL - Select all rows in a table where it's ids in another table as string field

  22. 22

    MySQL - How to select rows in a table where id value is in a comma delimited field in another table?

  23. 23

    select a field values that are not found in another table

  24. 24

    select a field values that are not found in another table

  25. 25

    SQL, select field if field doesn't exist in another table

  26. 26

    SQL, select field if field doesn't exist in another table

  27. 27

    How to create new field in view with some offset (field of table) from existing field (another field of table)?

  28. 28

    Fastest way to count from a table where a certain field exists in another table?

  29. 29

    Select from JSONB field with WHERE clause

HotTag

Archive