Question

Locked

How to collect desired data from two SQL tables?

By King Shary ·
I have two sql data tables
Table1 contains:
ACNO , NAME , CLASS
Table2 contains:
ACNO , NAME , FMONTH

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.

3 total posts (Page 1 of 1)  
| 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...
SELECT *
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 ...))

Back to Web Development Forum
3 total posts (Page 1 of 1)  

Related Discussions

Related Forums