0

See i have two table named Studentmaster-rollno,name,permanentaddress1,permanentzipcode
studentacademocdetails-rollno,dptname,status,programid

I want to select roll no of a student with permanent address like "chennai" and permannet zipcode=60004 and from second table i have to select dptname,status where status will be like('c','f,,'t','k')
I tried a query as follows

SELECT t1.rollno,t1.firstname,t1.permanentaddress1,t1.Permanentaddress2 ,t1.Permanentzip, t2.departmentcode,
t2.status,t2.programid
FROM studentmaster t1
INNER JOIN studentacademicdetails t2 ON t1.rollno = t2.rollno 
where t2.status in('c','f','k','t')
and
t1.Permanentstate like 'tamil%'
and
t1.Permanentaddress1 like 'chennai%' 
and t1.Permanentaddress2 like 'chennai%' 
and t1.Permanentzip like '600%'

help me out

Edited by pritaeas: Moved to databases.

2
Contributors
1
Reply
17
Views
3 Years
Discussion Span
Last Post by rch1231
0

So what was wrong with your query other than you tried to select a field Permanentaddress2 that was not listed in the definition you provided or the criteria you listed. Also you are narrowing down to Permanentstate which you did not list in your definition or criteria.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.