Web Development



How to collect desired data from two SQL tables?

By King Shary ·
I have two sql data tables
Table1 contains:
Table2 contains:

ACNO => Acount Number
NAME => Student Name
FMONTH => Fee Month

I want to get the names of those students who didn't paid the fees for a particular month e.g. May

This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Answers

Collapse -

insufficient information

by john.a.wills In reply to How to collect desired da ...

for your specific problem, because there is no marker as to whether fees have been paid. However, the usual way to draw data from two tables at once is to join the tables...
FROM Table1 LEFT JOIN Table2 on Table1.ACNO = Table2.ACNO
You should be aware that there is probably a design mistake in your tables,as NAME appear in two tables and does not seem to be a key.

Collapse -

Homework Hint

by oldbaritone In reply to How to collect desired da ...

go back and review SELECT and JOIN statements

(SELECT x,y,z from (tbl.a JOIN tbl.b ON ...))

Related Discussions

Related Forums