0

I have two tables that are related

that table is teachers and attendance

that 2 tables, is related with field teachers.id and attendance.id_teachers

now my question is, how to displaying teachers data which is that teachers data (teachers.id) is not listed in attendance table

i hope you guys understand what i'm hoping for...

I appreciate every answer

thanks

1

2 Answers 2

0

You can try with this:

SELECT * FROM teachers WHERE id NOT IN (SELECT id_teachers FROM attendance)
Sign up to request clarification or add additional context in comments.

Comments

0

IN clause is your friend here. You may want to read-up on this. Following query should give the result:

select * from teachers where id not in (select id_teachers from attendance)

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.