Home » Developer & Programmer » Reports & Discoverer » reports
reports [message #89014] Thu, 31 July 2003 13:40 Go to next message
Geeta
Messages: 3
Registered: July 2003
Junior Member
I'm developing a report which consists a query, it incudes 5 queries by union. in the report i would like to print the serial number, if i take the rownum it is repeating as the query returns rows from 5 different queries. i should get the serial number in sequence for all the rows.
please let me know is any of you have any sugessions?
Re: reports [message #89016 is a reply to message #89014] Sat, 02 August 2003 03:29 Go to previous messageGo to next message
Ali
Messages: 88
Registered: March 2000
Member
create summary column
suppose i have query like this

1 select dept.deptno,emp.empno,emp.sal from scott.emp, scott.dept
2* where emp.deptno = dept.deptno
SQL> /

DEPTNO EMPNO SAL
--------- --------- ---------
20 7369 800
30 7499 1600
30 7521 1250
20 7566 2975
30 7654 1250
30 7698 2850
10 7782 2450
20 7788 3000
10 7839 5000
30 7844 1500
20 7876 1100
30 7900 950
20 7902 3000
10 7934 1300

14 rows selected.

my report is group above (grouping on dept.deptno)
i want to generate serial no on employees in each depot

10 1. 7934
2. 7839
3. 7782
20 1. 7902
2. 7876
3. 7788
30 1. 7900
2. 7844
now in report i have two groups g_dept containing deptno and g_emp containing empno

for it i simply create summary column in group g_emp

function = count
source = empno
reset at = deptno

now create feild and put summary column in source of feild.
Re: reports [message #89018 is a reply to message #89014] Sat, 02 August 2003 05:02 Go to previous messageGo to next message
sureshkumar
Messages: 5
Registered: May 2000
Junior Member
Hi ,

U can try this..

select 1 no,ename from emp;
union
select 0 no,ename from emp;

use first query of union 1st field is number column...
based on 1st field u can use count of that column..
Hope it will work,..
Regards
Suresh
Re: reports [message #89021 is a reply to message #89014] Mon, 04 August 2003 00:07 Go to previous message
sujit
Messages: 94
Registered: April 2002
Member
hi,
use a "summary column" to "count" the row. it will not return duplicate rows.
Sujit
Previous Topic: Report Parameter Form
Next Topic: how to stop continuous printing
Goto Forum:
  


Current Time: Thu Mar 28 19:42:39 CDT 2024