I'm getting the above error when the user searches for a particular contact name. I have 4 tables viz.Section(Section_Name,Section_ID),Report(Report_Name,Report_ID,Section_ID,Conta ct_ID,ZipFile_IND,Last_Updated,Link,link_id),Contact(Contact_Name,Contact_ID,link_id),Metrics(Metric_Name,Metric_ID,Segment _ID, Report_ID, ZipFile_IND, Report_ID_ZIP, Metric_Def, Metric_ Segment,link_id)
Now, the user basically searches for a contact_name and on successful search, the following details should get printed:-Section.Section_Name , Report.Report_Name , Report.Link, Contact.Contact_Name, Metrics.Metric_Name
my sql query is :-String sqlq="select Section.Section_Name , Report.Report_Name , Report.Link, Contact.Contact_Name, Metrics.Metric_Name "+ "FROM Section , Report , Contact, Metrics"+ " WHERE Report.Section_ID=Section.Section_ID and Metrics.Report_ID=Report.Report_ID "+ "and Report.Report_ID IN (SELECT Report.Report_ID FROM Report WHERE "+ "Contact.Contact_ID=Report.Contact_ID and Contact.Contact_Name LIKE '%"+category+"%' and Metrics.Metric_Segment = 'M') ORDER BY Report_Name ";
So, where is the error in the sqlquery ?


Check Solution