C# .NET - how to write sql query for my requirement.

Asked By Dvorkin on 07-Feb-13 04:31 AM
I have two tables, Students and Fees. Students table contains Student Related Data and Fees table contains Fee record of Students.
 
Actually, My problem is i want to show defaulter students who have not paid this month fee.
 
Sol. seems to me is :
I want to search all Students first from Students table, then query should search in Fee table for students who have not paid their fee of this month of Current Year..\
 
My Question is How to write query for my above requirement.
Pranay replied to Dvorkin on 12-Feb-13 03:41 PM
Try this ...
Select  s.studentname from Students as s , Fees as f join on s.StudentId = f.StudentId where f.Fees = "not paid"
something like this ... but way to go is using  sql join