2
Answers

a simple SQL

aylin_sk

aylin_sk

20y
2.3k
1
How can i get output like this from this sql?? Output: First row: initial values of the fields Second row: average of the same fields Please help me... select * from ( select HEM_LOKOSIT, HEM_NNS from LPMS.HEMOGRAMS where HEM_PATIENT_ID = 33 union select AVG(HEM_LOKOSIT), AVG(HEM_NNS) from LPMS.HEMOGRAMS where HEM_PATIENT_ID = 33) order by HEM_LOKOSIT desc nulls last;
Answers (2)
0
aylin_sk

aylin_sk

NA 87 0 20y
Thanks Feras...
0
ferasdeeb

ferasdeeb

NA 24 0 20y
you should check out the analytical and grouping functions provided by orcale 8i or more i mean the cube and rollup functions ... it contains a perfect solution for your problems ... but they are available only with oracle 8i or more .... read about it in oracle documentation, it is so helpfull functions for summerizing your SQL code and eliminating complexity and SAVING the query time Feras
Next Recommended Forum