|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
report building in sqlplus
why does this code only return one 'compute' statement:
l06db > get formatted_system_test_project.sql 1 clear breaks 2 clear computes 3 break on profile_id skip 3 4 compute max of test_time on profile_id 5 compute min of test_time on profile_id 6 select distinct(track_id), meas_seq,test_results.meas_code,test_time, stn_id, test_count, test_header.profile_id,test_hea der.profile_ver from test_header,test_results,meas_spec 7 where test_results.test_link_id in (select test_link_id from test_header 8 where track_id = 'LPB0340138') 9 and test_header.test_link_id = test_results.test_link_id 10 and test_results.meas_code = meas_spec.meas_code 11 and test_header.profile_id = meas_spec.profile_id 12 and test_header.profile_ver = meas_spec.profile_ver 13 group by test_results.meas_code,meas_seq,test_count,test_time,track_id,stn_id, test_header.profile_id,test_header.profile _ver 14* order by meas_seq 15 OUTPUT from above script: TRACK_ID MEAS_SEQ MEAS_COD TEST_TIME STN_ID TEST_COUNT PROFILE_ID PROFILE_ ---------------- ---------- -------- ---------- -------- ---------- ------------ -------- LPB0340138 102 SCCpACTG .77 L2S01ABT 4 PBBL_BT_1 20050122 ---------- ************ .77 minimum LPB0340138 102 SCCpACTG .79 L2S05ABT 5 PBBL_BT_1_89 20050122 ---------- ************ .79 minimum |
|
#2
|
|||
|
|||
|
according to oracle specification, If multiple COMPUTE commands reference the same column in the ON clause, only the last COMPUTE command applies. but you can use multiple function in COMPUTE clause by using space in the same COMPUTE, for example
Code:
BREAK ON DEPTNO COMPUTE MIN MAX OF SAL ON DEPTNO SELECT empno, ename, sal, deptno FROM emp ORDER BY deptno / |
|
#3
|
|||
|
|||
|
Quote:
Thanks! Works great. Now a new question, for the same script: clear breaks clear computes break on profile_id skip 3 compute min max avg of test_time on profile_id select distinct(track_id), meas_seq,test_results.meas_code,test_time, stn_id, test_count, test_header.profile_id,test_header.p rofile_ver from test_header,test_results,meas_spec where test_results.test_link_id in (select test_link_id from test_header where track_id = 'LPB0340138') and test_header.test_link_id = test_results.test_link_id and test_results.meas_code = meas_spec.meas_code and test_header.profile_id = meas_spec.profile_id and test_header.profile_ver = meas_spec.profile_ver group by test_results.meas_code,meas_seq,test_count,test_time,track_id,stn_id, test_header.profile_id,test_header.profile_ver order by meas_seq / output is: l06db > @formatted_system_test_project.sql TRACK_ID MEAS_SEQ MEAS_COD TEST_TIME STN_ID TEST_COUNT PROFILE_ID PROFILE_ ---------------- ---------- -------- ---------- -------- ---------- ------------ -------- LPB0340138 1 STRT_TST 0 L2S07ABT 1 PBBL_BT_1 20050122 LPB0340138 1 STRT_TST 0 L2S01ABT 2 20050122 LPB0340138 1 STRT_TST .05 L2S01ABT 3 20050122 LPB0340138 1 STRT_TST .01 L2S01ABT 4 20050122 ---------- ************ .015 avg 0 minimum .05 maximum LPB0340138 1 STRT_TST .01 L2S05ABT 5 PBBL_BT_1_89 20050122 ---------- ************ .01 avg .01 minimum .01 maximum How can i get the difference of the two averages? |
|
#4
|
|||
|
|||
|
some info
Did you get an answer to this,
I also have two totals and want to calculate average from two totals: total1*100/total2 should be displayed in the avg field. Let me know how u can help Quote:
|
![]() |
| Viewing: Dev Shed Forums > Databases > Oracle Development > report building in sqlplus |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|