Jump to content

couldn\'t design query in IReport


maanikmca

Recommended Posts

 

Here i have posted my Table Structure..Here am extracting details for Faculty Invigilation from Database

SQL> desc roomallot;


 Name                         

             Null?    Type
 -----------------------------------------     --------     ----------------------------
 RDATE                                                  DATE
 RNO                                                      NUMBER(10)
 SUBCODE                                            VARCHAR2(15)
 SESS                                                   VARCHAR2(5)
 STNO                                                   VARCHAR2(20)
 ENNO                                                   VARCHAR2(20)
 FACULTY                                              VARCHAR2(25)
 SEM                                                     VARCHAR2(15)
 TRANSID                             NOT NULL  NUMBER(20)
 COUNTER                                             NUMBER(30)


This is the Query,which is giving me an Error,


Query
 
{ SELECT
     ROOMALLOT."FACULTY" AS ROOMALLOT_FACULTY,
     COUNT(*)  AS ROOMALLOT_COUNT   FROM
(SELECT DISTINCT  ROOMALLOT."FACULTY", ROOMALLOT."RDATE", ROOMALLOT."SESS"  FROM
 "MODULE4"."ROOMALLOT"  ROOMALLOT)  GROUP BY  ROOMALLOT."FACULTY" }
 
 
it gives me an Error.
 
 
Error: "ROOMALLOT"."FACULTY": invalid identifier
 
could you please sort out my as much as earlier..
 
advanc thanks..
Link to comment
Share on other sites

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

hi maanik777,

 

try this :

 

{ SELECT
     random_name."FACULTY" AS ROOMALLOT_FACULTY,
     COUNT(*)  AS ROOMALLOT_COUNT   FROM
( SELECT DISTINCT  ROOMALLOT."FACULTY", ROOMALLOT."RDATE", ROOMALLOT."SESS"  FROM
 "MODULE4"."ROOMALLOT"  ROOMALLOT ) random_name  GROUP BY  random_name."FACULTY" }

 

hope that helps

_o/

Link to comment
Share on other sites

maanik777,

It's not really an iReport question. You might be better help on an Oracle forum.

Having said that... I can't help making a guess. You need to alias your subquery in Oracle. I forget if it requires the use of "AS" or requires that you do not use "AS". But something like this ought to work:

SELECT
     ROOMALLOT."FACULTY" AS ROOMALLOT_FACULTY,
     COUNT(*)  AS ROOMALLOT_COUNT   FROM
(SELECT DISTINCT  ROOMALLOT."FACULTY", ROOMALLOT."RDATE", ROOMALLOT."SESS"  FROM
 "MODULE4"."ROOMALLOT"  ROOMALLOT) AS MYSUBQUERY GROUP BY  ROOMALLOT."FACULTY"

Regards,
Matt

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...