title: How do I get rid of a whole row of NULL when I'm using a UNION?
body: <pre><code>Select * from OPENQUERY (PORTAL,
  ''SELECT st.last AS "Last Name", st.first AS "First Name", ct.DeviceName, SUM
           (ct.PageCount) AS "Count", pm.TotalPerPage
  FROM printer_stats.Counts ct 
  INNER JOIN dv.staff st on st.id = ct.UserID
  LEFT JOIN network_map.PrintersToDevices ptd ON ptd.DeviceID = ct.DeviceID
  LEFT JOIN network_map.PrinterModels pm ON ptd.PrinterID = pm.PrinterID
  WHERE ct.UserID = "'+@UserID+'" and ct.PageCount &gt; 0 and ct.Date &gt;= "'+@AcademicYTD+'"
  UNION
   SELECT stu.last_name AS "Last Namae", stu.first_name AS "First Name", 
  ct.DeviceName,SUM(ct.PageCount) AS "Count", pm.TotalPerPage 
  FROM printer_stats.Counts ct
  INNER JOIN dv.student stu on stu.username = ct.Username
  LEFT JOIN network_map.PrintersToDevices ptd ON ptd.DeviceID = ct.DeviceID
  LEFT JOIN network_map.PrinterModels pm ON ptd.PrinterID = pm.PrinterID
  WHERE ct.UserID = "'+@UserID+'" and ct.PageCount &gt; 0 and ct.Date  
  &gt;= "'+@AcademicYTD+'" 
  GROUP BY ct.DeviceName 
  ORDER BY 4 DESC'')
  </code></pre>
  
  <p>I get results like this:</p>
  
  <pre><code> Last Name  First Name DeviceName       Count TotalPerPage
   Stewart    Jesse      BG-LMC-HP4100-01 39    0.0287581
   Stewart    Jesse      BG-LMC-HP4100-02 9     0.0287581
   Stewart    Jesse      BG-903-RI4210    2     0.013341
   Stewart    Jesse      BG-218-HP4000    1     0.013341
   NULL       NULL       NULL             NULL  NULL
  </code></pre>
  
  <p>I don't want the last row of all NULLS. </p>
  
  <p>I know they are coming from the first <code>SELECT</code> for Staff since there should be no matching rows: The user is a Student, so there wouldn't be a match. </p>
  
  <p>I need to know how to only show rows with data in all fields.</p>