SQL to retrieve alerts from PDMDB