Forum Moderators: open

Message Too Old, No Replies

Finding values in a text list that are NOT in MySQL

         

csdude55

12:26 am on Mar 9, 2023 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I have a table of one column with 178 rows.

I have a text list of 200 values.

I need to figure out the 22 text values that aren't already in MySQL.

Any suggestions? I'm hoping there's a cool query trick I can do in phpMyAdmin rather than writing a separate PHP script, but I can't think of any :-/

phranque

1:11 am on Mar 9, 2023 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



it may not be the most elegant solution, but i would try using REGEXP_LIKE in the WHERE clause.

csdude55

5:19 am on Mar 9, 2023 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I'm not sure that I understand. Can you give me an example?

Say that I have a text list of:

foo
bar
lorem

and MySQL's table.colA has these rows:

lorem
ipsum
this
that
the other thing

I need the query to return "foo" and "bar" (the ones in the list that aren't in the table).

phranque

10:24 pm on Mar 9, 2023 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



sorry - i misunderstood your problem statement.

i don't think you can do that with a query.
you need to write a script for that.

maybe ChatGPT can write something for you LOL

tangor

4:49 am on Mar 10, 2023 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I'd do a "not equal" against table.colA, but since I am still "stuck" in Access mySql is very minimal!