SELECT COUNT(*) FROM notification n, notification_pending p WHERE n.objid = p.objid ; SELECT p.objid, n.filetype, n.chunkcount, n.chunksize, n.messagetype, p.indexno FROM notification n, notification_pending p WHERE n.objid = p.objid ORDER BY n.dtfiled LIMIT 10 ; update notification_pending set indexno = 0 where objid ='MSG3242ad46:16dd24bdaae:-4023';