Skip to content
Advertisement

Two table compare and list php [closed]

there are two different tables. I want to find the expressions with “%USD” in the columns of the same name in these two tables do not match and list them on the screen.

Table 1 query;

JavaScript

table 2 query;

JavaScript

How can I list expressions that are not between two tables?

Advertisement

Answer

I may not be understanding your question fully. If you want to list symbols that begin with ‘USD’ that are in tableA but not in tableB along with symbols in tableB that begin with USD that are not in tableA, then the following query should return those symbols:

JavaScript

Or you can use outer joins instead:

JavaScript

In either case, performance will be improved in you have indexes on the symbol columns.

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement