I have two tables, tableA and tableB as below:
tableA:
id | name | age
---|------------|--------
1 | John | 26
2 | Michal | 30
3 | Watson | 28
4 | samson | 25
tableB:
name | occupation
---------|---------------
John | job
Michal | business
watson | job
I want to match two tables in such way that I can get non-matching row 'name:samson' from tableA. Which query (from PHP script) should I have to use?
Run this query in PHP. You will get the solution.
$qry = "SELECT a.* FROM tableA AS a, b.* FROM tableB AS b WHERE a.name <> b.name";
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments