Note that there are some explanatory texts on larger screens.

plurals
  1. POhow to bind aggregated alias column with gridview
    primarykey
    data
    text
    <p>I have following query which returning a table of aggregated column . but when i try to bind this using datatable i does not get. required result. </p> <p>Table:</p> <pre><code>5 6 0 1 Male 2013-06-07 00:00:00.0000000 0 0 0 6 6 2 0 Female 2013-06-07 00:00:00.0000000 1 0 0 7 6 3 0 Male 2013-06-07 00:00:00.0000000 0 1 0 8 6 4 0 Male 2013-06-07 00:00:00.0000000 0 0 1 9 6 5 0 Female 2013-06-07 00:00:00.0000000 0 0 1 10 6 7 1 Female 2013-06-07 00:00:00.0000000 0 0 0 11 6 8 1 Male 2013-06-07 00:00:00.0000000 0 0 0 12 6 9 0 Female 2013-06-07 00:00:00.0000000 1 0 0 13 6 10 0 Male 2013-06-07 00:00:00.0000000 0 1 0 14 6 10 1 Male 2013-06-07 00:00:00.0000000 0 0 0 15 6 10 1 Female 2013-06-07 00:00:00.0000000 0 0 0 16 6 10 0 Male 2013-06-07 00:00:00.0000000 1 0 0 17 6 10 0 Female 2013-06-07 00:00:00.0000000 1 0 0 18 7 5 0 Female 2013-06-07 00:00:00.0000000 1 0 0 19 7 1 0 Male 2013-06-07 00:00:00.0000000 1 0 0 20 6 6 0 Female 2013-06-11 00:00:00.0000000 0 0 1 </code></pre> <p>Query:</p> <pre><code>select e.Nme ,sum(case when m.gender='Male' then 1 else 0 end) as Male ,sum(case when m.gender='FeMale' then 1 else 0 end)as FeMale ,sum(m.seg1to5)Seg0to5 ,sum(m.seg5to15)Seg5to15 ,sum(m.seg15to46)Seg15to45 ,sum(m.seg45plus)seg45plus from eventundersurv e full outer join mchcmain m on e.ID=m.eventid where m.unitid=2 or e.Nme is not null group by e.Nme </code></pre> <p>Result:</p> <pre><code>Acute Diarrhea 1 0 0 1 0 0 AWD/ Suspected Cholera 0 1 0 1 0 0 Blood Grouping Tests 0 0 NULL NULL NULL NULL Blood Sugar Tests 0 0 NULL NULL NULL NULL Bloody Diarrhea 1 0 0 0 1 0 Bronchial Asthma 0 0 NULL NULL NULL NULL Diabetes 0 0 NULL NULL NULL NULL E.P.I VACCINE 0 0 NULL NULL NULL NULL Follow up 0 0 NULL NULL NULL NULL FP 0 0 NULL NULL NULL NULL Hb Tests 0 0 NULL NULL NULL NULL Hepatitis B Screening 0 0 NULL NULL NULL NULL Hepatitis C Screening 0 0 NULL NULL NULL NULL Hypertension 0 0 NULL NULL NULL NULL Injuries 0 0 NULL NULL NULL NULL Lower Resp. Tract Infection 0 1 0 0 0 1 Moderate Malnutrition (WfA -2 to -3Z) Orange zone 0 0 NULL NULL NULL NULL Neonatal Tetanus 1 0 1 0 0 0 No. of Antenatal Consultations without Ultrasound 0 0 NULL NULL NULL NULL No. of normal deliveries 0 0 NULL NULL NULL NULL No. of Postnatal Consultations 0 0 NULL NULL NULL NULL No. of Pregnant women referred 0 0 NULL NULL NULL NULL No. of Ultrasounds performed Antenatal + Ultrasound General Ultrasound 0 0 NULL NULL NULL NULL Others 0 0 NULL NULL NULL NULL Pregnancy Tests 0 0 NULL NULL NULL NULL Referred 0 0 NULL NULL NULL NULL Scabies 0 0 NULL NULL NULL NULL Skin Disease 0 0 NULL NULL NULL NULL Suspected Hemorrhagic Fever 0 1 0 1 0 0 Suspected Malaria 1 0 0 0 0 1 Suspected Measles 0 1 1 0 0 0 TT Vaccination of Pregnant Women 0 0 NULL NULL NULL NULL Unexplained Fever &gt;38.5 3 2 2 2 1 0 Upper Resp.Tract Infection 0 2 0 1 0 1 </code></pre> <p>I need to display results in above form on gridview. but I'm not getting result alias columns</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload