-1

I want to show data where data is not in other tables.

enter image description here

Masivuye Cokile
  • 4,754
  • 3
  • 19
  • 34
Aditya
  • 63
  • 7
  • Can you share the code that you used so far? – Ende Jun 04 '18 at 14:26
  • 2
    Possible duplicate of [SQL - find records from one table which don't exist in another](https://stackoverflow.com/questions/367863/sql-find-records-from-one-table-which-dont-exist-in-another) – Masivuye Cokile Jun 04 '18 at 14:27
  • See: [Why should I provide an MCVE for what seems to me to be a very simple SQL query?](https://meta.stackoverflow.com/questions/333952/why-should-i-provide-an-mcve-for-what-seems-to-me-to-be-a-very-simple-sql-query) – Strawberry Jun 04 '18 at 14:28
  • This is not a PHP, nor mysqli question. Look at `join`s with `mysql`. – user3783243 Jun 04 '18 at 14:28

1 Answers1

-1

Use a sub query.

SELECT a.* 
FROM tabel_a a
WHERE a.id NOT IN (SELECT b.id FROM tabel_b b)

Output

id  name
1   aa
2   bb

SQL Fiddle: http://sqlfiddle.com/#!9/8d5a32/6/0

Matt
  • 14,906
  • 27
  • 99
  • 149