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

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.