Index: /tags/ipp-20110218/pstamp/scripts/psstatus
===================================================================
--- /tags/ipp-20110218/pstamp/scripts/psstatus	(revision 30696)
+++ /tags/ipp-20110218/pstamp/scripts/psstatus	(revision 30697)
@@ -44,7 +44,9 @@
 
 my $totals_query = "
-SELECT label, count(job_id) AS 'Unfinished Jobs', priority
+SELECT label,
+    count(job_id) AS 'Unfinished Jobs',
+    IFNULL(priority,10000) as priority
 FROM pstampRequest join pstampJob USING(req_id)
-JOIN Label USING(label)
+LEFT JOIN Label USING(label)
 WHERE pstampJob.state ='run' and pstampRequest.state ='run'
 GROUP by label";
@@ -75,7 +77,7 @@
         pstampRequest.fault,
         timestamp,
-        priority
-FROM pstampRequest
-JOIN Label USING(label)
+        IFNULL(priority,10000) AS priority
+FROM pstampRequest
+LEFT JOIN Label USING(label)
     WHERE pstampRequest.state = 'run' or pstampRequest.state ='new' 
    --     OR pstampRequest.state = 'run.wait'
