Jump to content

Archived

This topic is now archived and is closed to further replies.

TheJuan

display student name that is not present in tbl_studentFees

Recommended Posts

hi

i just wondering how can it be possible to make a query of this situation.
I have a list of student name in tbl_students and a table tbl_payments where stored a list of students(id,name,amount) who already pay for a fee.

i want to display those all name of students that are in tbl_students but not yet in tbl_payments

something like:
select id,name from tbl_student where id is not present in tbl_payments

thanks

Share this post


Link to post
Share on other sites
This calls for a LEFT JOIN (UNTESTED):

[code]SELECT s.id, s.name
FROM tbl_student AS s
LEFT JOIN tbl_payments AS p ON s.id = p.student_id
WHERE p.student_id IS NULL[/code]

Hope that helps.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.