How to select non-matching rows from two mysql table

stockBoi

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?

Kumar V

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.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Select rows from a table matching other table records

From Dev

How to generate a query which consider data from one table and correspondingly fill 0 for non matching fields in mysql

From Dev

Select last two rows from mysql php

From Dev

How to get matching and non matching rows from a SQL Join

From Dev

Delete rows in MySQL matching two columns in another table

From Dev

MySQL insert id values from other table into matching rows

From Dev

MySQL select row with two matching joined rows from another table

From Dev

mysql: select rows from another table as columns

From Dev

Select rows from a table based on results from two other tables in mySQL using PDO

From Dev

Efficiently deleting rows from one table where not matching another [MySQL]

From Dev

join two table with non-matching rows

From Dev

MySQL: Select non matching rows in a join

From Dev

Select rows from a table matching other table records

From Dev

How to generate a query which consider data from one table and correspondingly fill 0 for non matching fields in mysql

From Dev

Delete rows in MySQL matching two columns in another table

From Dev

How to select bi-directional mapped rows from a table in MySQL?

From Dev

MySQL - How to select only two columns from a row in one table

From Dev

MySQL Best select query from two table

From Dev

How to select a set of rows from a table by matching columns?

From Dev

Make a SELECT query from two tables with one record from matching rows in mysql

From Dev

MySQL: Update rows in table, from rows with matching key in another table

From Dev

mysql select from table where two (or more) rows match,

From Dev

Select partialy matching rows from two differernt table in KDB?

From Dev

MySQL query to select rows matching criteria and rows related to the matching rows

From Dev

how to select one row from one table and multiple rows from other table using joins in mysql,

From Dev

How to SELECT none matching rows from one table to another?

From Dev

How to delete rows from one table matching another table?

From Dev

MYSQL: select all rows from table matching a combination and the opposite

From Dev

query to select non matching records from two tables

Related Related

  1. 1

    Select rows from a table matching other table records

  2. 2

    How to generate a query which consider data from one table and correspondingly fill 0 for non matching fields in mysql

  3. 3

    Select last two rows from mysql php

  4. 4

    How to get matching and non matching rows from a SQL Join

  5. 5

    Delete rows in MySQL matching two columns in another table

  6. 6

    MySQL insert id values from other table into matching rows

  7. 7

    MySQL select row with two matching joined rows from another table

  8. 8

    mysql: select rows from another table as columns

  9. 9

    Select rows from a table based on results from two other tables in mySQL using PDO

  10. 10

    Efficiently deleting rows from one table where not matching another [MySQL]

  11. 11

    join two table with non-matching rows

  12. 12

    MySQL: Select non matching rows in a join

  13. 13

    Select rows from a table matching other table records

  14. 14

    How to generate a query which consider data from one table and correspondingly fill 0 for non matching fields in mysql

  15. 15

    Delete rows in MySQL matching two columns in another table

  16. 16

    How to select bi-directional mapped rows from a table in MySQL?

  17. 17

    MySQL - How to select only two columns from a row in one table

  18. 18

    MySQL Best select query from two table

  19. 19

    How to select a set of rows from a table by matching columns?

  20. 20

    Make a SELECT query from two tables with one record from matching rows in mysql

  21. 21

    MySQL: Update rows in table, from rows with matching key in another table

  22. 22

    mysql select from table where two (or more) rows match,

  23. 23

    Select partialy matching rows from two differernt table in KDB?

  24. 24

    MySQL query to select rows matching criteria and rows related to the matching rows

  25. 25

    how to select one row from one table and multiple rows from other table using joins in mysql,

  26. 26

    How to SELECT none matching rows from one table to another?

  27. 27

    How to delete rows from one table matching another table?

  28. 28

    MYSQL: select all rows from table matching a combination and the opposite

  29. 29

    query to select non matching records from two tables

HotTag

Archive