I bumped into a question in Stackedoverflow. It looks as a simple issue, but confuses Jaspersoft Studio user. The issue is getting an error while using subselect statement in SQL. So I created a sample report with subselect statement.

1) I used the Sample Database to create the report.

2) My Query is as follows.

SS_Img1

3) Notice that there is a red underline mark under subselect. The error message is as follows

SS_Img2

4) But if we Ignore this error and click on “Read Fields”, Jaspersoft Studio will read the columns as followsSS_Img3

5) Now I click on OK and drag and drop the fields onto my detail section. (as follows)

SS_Img4

6) and The preview as follows.

SS_Img5

So, when using the subselect in SQL Query, ignore the error message and run the report.